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
Array.prototype.pushAndReturn = function(elem) {
this.push(elem);
return this;
}
function pushToArray(arr0, elem) {
arr0.push(elem);
return arr0;
}
const arr = [...Array(10000).fill(0).map(x => Math.random())];
let out = [];Ready to run.
| Test | Ops/sec | |
|---|---|---|
| Regular Array.push in for loop | | ready |
| pushToArray in for loop | | ready |
| pushAndReturn in for loop | | ready |
| spread in reduce | | ready |
| pushToArray in reduce | | ready |
| pushAndReturn in reduce | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.