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 cnt = 10
const a = Array.from(new Array(cnt).keys())
const b = Array.from(new Array(cnt).keys()).reverse()
function compare1(a, b) {
if (a.length !== b.length) return false
const newA = a.sort()
const newB = b.sort()
return newA.join(',') === newB.join(',')
}
function compare2(a, b) {
return a.length === b.length && new Set(a.concat(b)).size === a.length
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Array equality with sort |
| ready |
Array equality with Set |
| ready |
Array equality with sort equal arrays |
| ready |
Array equality with Set equal arrays |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.