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
const N = 10_000;
const TEST_N = 1000;
const getStrHash = (i) => `fjklsdjflk${i}jfkladfd`;
const intIds = Array(N).fill(null).map((_, i) => i);
const strIds = intIds.map(getStrHash);
const getRandomElem = (arr) => arr[Math.floor(Math.random()*arr.length)];
const intToValArr = intIds.reduce((arr, e) => {
arr[e] = e + '124124124';
return arr;
}, []);
const intToValMap = Object.fromEntries(intIds.map(e => [e, e + '124124124']));
const strToValMap = Object.fromEntries(strIds.map(e => [e, e + '124124124']));
Ready to run.
Test | Ops/sec | |
---|---|---|
1 |
| ready |
2 |
| ready |
3 |
| ready |
4 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.