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 pObject(name) {
this.x_ = 1;
}
pObject.prototype.get = function() { return this.x_; };
pObject.prototype.set = function(_x) { this.x_ = _x; };
function cObject(_x) {
var x_ = _x;
return {
'get': function() { return x_; },
'set': function(_x) { x_ = _x; }
};
};
function oObject(_x) {
return {
'x_': _x,
'get': pObject.prototype.get,
'set': pObject.prototype.set
};
};
var _p = [];
var _c = [];
var _o = [];
for (var i = 0; i < 10000; ++i) {
_p.push(new pObject(i));
_c.push(cObject(i));
_o.push(oObject(i));
}
var cTotal = 0;
var pTotal = 0;
var oTotal = 0;
Ready to run.
Test | Ops/sec | |
---|---|---|
Prototype |
| ready |
Closure |
| ready |
Object |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.