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 T1() {}
for (var i = 0; i < 100; i++)
T1.prototype["myMethod_" + i] = function() {};
function T2() {
for (var i = 0; i < 100; i++)
this["myMethod_" + i] = function() {};
}
function T3() {
for (var i = 0; i < 100; i++)
this["test_" + i] = [false, 0, "0"];
}
function T4() {
for (var i = 0; i < 30; i++)
this["myMethod_" + i] = function() {
for (var i = 0; i < 30; i++)
this.a = [false, 0, "0", function() {}];
};
}
function T5() {
for (var i = 0; i < 30; i++)
this["myMethod_" + i] = function() {
for (var i = 0; i < 30; i++)
this.a = [false, 0, "0", function() {}];
};
for (var i = 0; i < 100; i++)
this["test_" + i] = [false, 0, "0"];
}
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.