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 = 100000
const a1 = new Array(N).fill(1).map((v, i) => v + i)
const a2 = new Array(N).fill(N+1).map((v, i) => v + i)
const set1 = new Set(a1);
const set2 = new Set(a2);
function union(set, ...iterables) {
const nextSet = new Set(set);
for (const iterable of iterables) {
for (const item of iterable) {
nextSet.add(item);
}
}
return nextSet;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Set.union() |
| ready |
Constructor + forEach |
| ready |
Constructor plus loop |
| ready |
Util |
| ready |
Generator |
| ready |
Spread |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.