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
// randomly generated N = 40 length array 0 <= A[N] <= 39
const array = Array.from({length: 40}, () => Math.floor(Math.random() * 40))
// randomly generated N = 4000 length array 0 <= A[N] <= 3999
// const array = Array.from({length: 4000}, () => Math.floor(Math.random() * 4000))
// randomly generated N = 3 length array 0 <= A[N] <= 2
// const array = Array.from({length: 3}, () => Math.floor(Math.random() * 3))
Ready to run.
Test | Ops/sec | |
---|---|---|
Using the spread operator |
| ready |
Using Function.prototype.apply() |
| ready |
Using .sort() |
| ready |
Using a for loop |
| ready |
Using .reduce() |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.