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 ary1 = [];
var ary2 = [];
var ary3 = [];
var ary4 = [];
var ary5 = [];
var resultAry = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
prepop(ary1, 1);
prepop(ary2, 2);
prepop(ary3, 5);
prepop(ary4, 8);
prepop(ary5, 10);
function prepop(ary, arySize) {
for (var x = 0; x < arySize; x++) {
ary.push(1);
}
}
Ready to run.
Test | Ops/sec | |
---|---|---|
array 1 concat |
| ready |
array 1 push loop |
| ready |
array 2 concat |
| ready |
array 2 push loop |
| ready |
array 3 concat |
| ready |
array 3 push loop |
| ready |
array 4 concat |
| ready |
array 4 push loop |
| ready |
array 5 concat |
| ready |
array 5 push loop |
| ready |
array 1 direct loop |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.