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 makeKey = () => Math.floor(Math.random() * 30); // number 0-29
const makeKeysAmount = () => (5 + Math.round(Math.random() * 10)); // number 5-15
const makeRecordKeys = () => Array(makeKeysAmount()).fill(0).map(() => makeKey()); // array of random amount of random numbers
const makeRecord = () => makeRecordKeys().reduce((o, k) => {
o[k] = true;
return o;
}, {}); // object like `{ 9: true, 14: true, 17: true, 24: true, 26: true, 29: true }`
const input = Array(1000).fill(0).map(() => makeRecord());Ready to run.
| Test | Ops/sec | |
|---|---|---|
| Double loop | | ready |
| Union | | ready |
| Collect then deduplicate | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.