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; // loop iters inside each test (jsPerf repeats externally)
const CAP_NONPOW2 = 1000; // generic ring capacity
const CAP_POW2 = 1024; // power-of-two capacity (for bitmask tests)
// Two queues so pow2/nonpow2 cases don't interfere
const qN = { head: 0, capacity: CAP_NONPOW2 };
const qP = { head: 0, capacity: CAP_POW2 };
// Global sink to defeat DCE
let sink = 0;
Ready to run.
| Test | Ops/sec | |
|---|---|---|
| ternary wrap | | ready |
| modulo | | ready |
| pre-increment + if | | ready |
| compare-subtract | | ready |
| boolean-mask subtract | | ready |
| modulo with power-of-two capacity | | ready |
| bitmask | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.