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
For some reason current Chrome is deopting when using push, so we're seeing really bad tests (+/- 30% margins = bad test).
Adding back push for comparison. Also expected inlining for comparison. I'm not sure why the VM isn't able to do this inlining for the extremely simple addOne
function, but clearly it's not.
for (var arr = [], arrLen = 1000; arrLen; arrLen--) arr.push(0);
var newArr = Array(arr.length);
function addOne(val) {
return val + 1;
}
arr = arrLen = newArr = addOne = null;
Ready to run.
Test | Ops/sec | |
---|---|---|
for loop |
| ready |
map |
| ready |
push |
| ready |
Expected inlining assignment |
| ready |
Expected inlining push |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.