jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
var Vector3 = function(x,y,z){
this.x = x;
this.y = y;
this.z = z;
};
Vector3.add = function(a,b){
a.x = a.x + b.x;
a.y = a.y + b.y;
a.z = a.z + b.z;
}
Vector3.prototype.add = function(b){
this.x += b.x;
this.y += b.y;
this.z += b.z;
};
Vector3.prototype.addMultiple = function(b,c,d,e){
this.x += b.x;
this.y += b.y;
this.z += b.z;
if (c) {
this.x += c.x;
this.y += c.y;
this.z += c.z;
}
if (d) {
this.x += d.x;
this.y += d.y;
this.z += d.z;
}
if (e) {
this.x += e.x;
this.y += e.y;
this.z += e.z;
}
};
Vector3.prototype.chainedadd = function(b){
this.x += b.x;
this.y += b.y;
this.z += b.z;
return this;
};
var a = new Vector3(0.1,0.2,0.4);
var b = new Vector3(1.98714,-0.2,0.5787789);
var c = new Vector3(-2.45478756325,0.2,-0.78254656);
var d = new Vector3(-1.98714,0.2,-0.5787789);
var e = new Vector3(2.45478756325,-0.2,0.78254656);
Ready to run.
Test | Ops/sec | |
---|---|---|
without optional arguments |
| ready |
with optional arguments1 |
| ready |
with optional arguments2 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.