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
let len = 10;
let player = {
x: 0,
y: 0,
w: 16,
h: 16,
update() {
return this.x;
}
};
function PlayerFactory(x, y) {
return {
x: x,
y: y,
w: 16,
h: 16,
update() {
return this.x;
}
};
}
function Entity(config) {
return {
x: x,
y: y,
w: 16,
h: 16,
update() {
return this.x;
},
...config
};
}
function PlayerFactoryEntity(config) {
return Entity(config);
}
function PlayerProto(x, y) {
this.x = x;
this.y = y;
this.w = 16;
this.h = 16;
this.update = () => {
return this.x;
};
return this;
}
class EntityClass {
constructor(x, y) {
this.x = x;
this.y = y;
}
update() {
return this.x;
}
}
class PlayerClass extends EntityClass {
constructor(x, y) {
super(x, y);
this.isPlayer = true;
}
}
Ready to run.
Test | Ops/sec | |
---|---|---|
POJO |
| ready |
Function factory |
| ready |
Function proto |
| ready |
Player Factory Entity |
| ready |
Player Class |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.