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 source = Array.from(Array(10000000).keys());
const stage1 = (s) => s % 2 === 0;
const stage2 = (s) => s * 3 % 4 == 0;
const stage3 = (s) => s % 999 === 0;
const stage4 = (s) => s / 2 === 0;
const stages = [
stage1,
stage2,
stage3,
stage4
]
const applyStages = (s) => {
for (let stage of stages) {
if (!stage(s)) { return false; }
}
return true;
}
const stage1Nodes = (nodes) => nodes.filter(stage1)
const stage2Nodes = (nodes) => nodes.filter(stage2)
const stage3Nodes = (nodes) => nodes.filter(stage3)
const stage4Nodes = (nodes) => nodes.filter(stage4)
Ready to run.
Test | Ops/sec | |
---|---|---|
filter |
| ready |
reduce |
| ready |
filter (int only) |
| ready |
for loop |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.