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 entities = [];
for (var i = 0; i < 10000; i++) {
entities.push({
id: Math.round(Math.random() * 10000000),
foo: 'abc',
bar: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam non libero at magna viverra tincidunt fringilla ut ante.',
baz: 1234,
fizz: true,
buzz: false,
stuff: 1234,
things: ['thing1', 'thing2', 'thing3', 'thing4', 'thing5'],
quxes: [
{ id: 1, name: 'one' },
{ id: 2, name: 'two' },
{ id: 3, name: 'three' },
{ id: 4, name: 'four' },
],
});
}
class AssignedModel {
constructor(properties) {
Object.assign(this, properties);
}
about() {
return this.id;
}
}
class SubsumedModel {
static toModel(entity) {
Object.setPrototypeOf(entity, this.prototype);
return entity;
}
about() {
return this.id;
}
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Object.assign |
| ready |
Object.setPrototypeOf |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.