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
function add(a, b){
return {
x: a.x+b.x,
y: a.y+b.y,
z: a.z+b.z}
}
class Vector3{
constructor(x,y,z){
this.x = x;
this.y = y;
this.z = z;
}
add(b){
this.x += b.x;
this.y += b.y;
this.z += b.z;
}
}
let positionFunctional = {x:0,y:0,z:0}
let velocityFunctional = {x:1,y:1,z:1}
const positionImperative = new Vector3(0,0,0);
const velocityImperative = new Vector3(1,1,1);
Ready to run.
Test | Ops/sec | |
---|---|---|
Add two Vector3s (Functional Style) |
| ready |
Add two Vector3s (Imperative Style) |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.