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
if (typeof Object.create !== 'function') {
Object.create = function(o) {
function F() {}
F.prototype = o;
return new F();
};
}
var Foo = {
bar: function() {
return this.num;
},
multi: function(by) {
return this.num * by;
}
};
var Foo2 = function(num) {
this.num = num;
}
var Foo3 = function(num) {
this.num = num;
}
Foo2.prototype = {
bar: function() {
return this.num;
},
multi: function(by) {
return this.num * by;
}
};
Foo3.prototype.bar = function() {
return this.num;
}
Foo3.prototype.multi = function(by) {
return this.num * by;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Object.create |
| ready |
Regular Prototype |
| ready |
Regular Prototype 2 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.