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
Uses fake or real private values to boot.
function T1(val) {this._fake = val;}
T1.prototype.myMethod = function() {return this._fake;};
function T2(val) {
this._fake = val;
// useless reasign
T2.prototype.myMethod = function() {return this._fake;};
}
function T3(val) {
this.myMethod = function() {return val;};
}
function T4(val) {
var real = val;
this.myMethod = function() {return real;};
}
function T5(val) {
var real = val;
// don't use capture
this.myMethod = function() {return;};
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Using prototype |
| ready |
Using this |
| ready |
Test 3 |
| ready |
Test 4 |
| ready |
Test 5 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.