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 elems = [
{"uid": "01", "type": "b", "val": 10},
{"uid": "02", "type": "b", "val": 10},
{"uid": "03", "type": "b", "val": 8},
{"uid": "04", "type": "b", "val": 7},
{"uid": "05", "type": "a", "val": 3},
{"uid": "06", "type": "b", "val": 4},
{"uid": "07", "type": "a", "val": 4},
{"uid": "08", "type": "b", "val": 4},
{"uid": "09", "type": "a", "val": 3},
{"uid": "10", "type": "a", "val": 7},
{"uid": "11", "type": "b", "val": 1},
{"uid": "12", "type": "b", "val": 5},
{"uid": "13", "type": "a", "val": 6},
{"uid": "14", "type": "b", "val": 4},
{"uid": "15", "type": "b", "val": 6},
{"uid": "16", "type": "b", "val": 2},
{"uid": "17", "type": "a", "val": 2},
{"uid": "18", "type": "a", "val": 1},
{"uid": "19", "type": "a", "val": 5},
{"uid": "20", "type": "b", "val": 10}
];
const index = {'a': [], 'b': []}
elems.forEach(function(el, idx) {
index[el.type].push(idx)
})
Ready to run.
Test | Ops/sec | |
---|---|---|
naive |
| ready |
indexed |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.