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
Comparison of different ways to treat the length of an array when iterating the array.
window.list = [];
var x = 100;
for (var y = 0; y < x; y++) {
window.list[y] = true;
}
delete window.list;
Ready to run.
Test | Ops/sec | |
---|---|---|
Using list.length |
| ready |
Using static len - outside for declr. |
| ready |
Using static len - inside for declr. |
| ready |
Reverse Loop (for) |
| ready |
Reverse Loop (while) |
| ready |
Reverse Loop (for) w/ outside declaration & -- |
| ready |
Reverse Loop (for) w/ outside declaration & >= 0 |
| ready |
Destructive array - shift |
| ready |
Destructive array - pop |
| ready |
Destructive array - pop w/ reverse |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.