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 ARR_SMALL = [...Array(10)].map((_, idx) => idx)
const PIVOT_SMALL = 7
const ARR_BIG = [...Array(10_000_000)].map((_, idx) => idx)
const PIVOT_BIG = 7_000_000
function filter_unstable(arr, item) {
const index = arr.indexOf(item);
if (index === -1) {
return;
}
const stop = arr.length - 1;
arr[index] = arr[stop];
arr.pop();
}
function filter_stable(arr, item) {
let index = arr.indexOf(item);
if (index === -1) {
return;
}
const stop = arr.length - 1;
while (index < stop) {
arr[index] = arr[++index];
}
arr.pop();
}
Ready to run.
Test | Ops/sec | |
---|---|---|
std (small) |
| ready |
stable (small) |
| ready |
unstable (small) |
| ready |
std (big) |
| ready |
stable (big) |
| ready |
unstable (big) |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.