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
// --- config ---
const N = 100000; // size of arrays per run
const RANGE = 1e6; // value range
// --- data (pre-generated once, shared by all tests) ---
const A = new Float64Array(N);
const B = new Float64Array(N);
for (let i = 0; i < N; i++) {
// Uniform-ish distribution across positive/negative
A[i] = (Math.random() * 2 - 1) * RANGE;
B[i] = (Math.random() * 2 - 1) * RANGE;
}
// Global sink to prevent dead-code elimination (shared across tests)
let sink = 0;
Ready to run.
| Test | Ops/sec | |
|---|---|---|
| Math.min | | ready |
| let + if | | ready |
| ternary | | ready |
| branchless | | ready |
| branchless d-form | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.