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
There are "holes" in the array, and I cared about only these two tests, so I removed all the others.
// 37.5% of the values in the array are "holes".
// There is a point where the number of holes justifies
// using an Object instead of an Array
var arr = [],
i, obj = {};
for (i = 15; i < 40; i += 1) {
var o = {
payload: i
};
arr[i] = o;
obj[i] = o;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Array Performance |
| ready |
Object Performance using known length |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.