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 a = [];
for (var i = 0; i < 100; i ++) a.push(i*2);
function Peek1(a) {
return a[a.length-1];
}
function Peek2(a) {
var x = a.pop();
a.push(x);
return x;
}
function Peek3(a) {
return a.slice(-1)[0];
}
function Peek4(a) {
return a.slice(-1).pop();
}
Ready to run.
Test | Ops/sec | |
---|---|---|
peek direct |
| ready |
peek pop push |
| ready |
peek slice |
| ready |
peek slice pop |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.