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 randomSmallNumber = (max) => Math.floor(Math.random() * max)
const slidesAfter = [];
const slidesBefore = [];
// random small array
for (let i; i < randomSmallNumber(10); i++) {
slidesAfter.push(randomSmallNumber(30));
slidesBefore.push(randomSmallNumber(30));
}
if (randomSmallNumber(1) === 1) {
slidesBefore.push(randomSmallNumber(30));
}
const checkIfSlidesChanged = (before, after) => {
if (before.length !== after.length) return true;
// if any slides don't match, then slides have changed
if (after.find((slide, idx) => slide !== before[idx])) return true;
return false;
};
Ready to run.
Test | Ops/sec | |
---|---|---|
JSON |
| ready |
iteration |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.