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 randomBall = () => Math.floor(Math.random() * 59) + 1
function generateRandomNumbers(count, max) {
let arr = Array.from({length: max}, (_, i) => i + 1);
for (let i = arr.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[arr[i], arr[j]] = [arr[j], arr[i]]; // Swap
}
return arr.slice(0, count);
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Sort and Slice |
| ready |
While checking |
| ready |
Pick unique random |
| ready |
While with obj |
| ready |
Sets |
| ready |
Fisher-Yates slice |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.