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
// Sizes per request
const N_ITEMS = 100;
const ROWS = 100;
const COLS = 50;
// Data: items with ids 0..99
const items = Array.from({ length: N_ITEMS }, (_, i) => ({ id: i, value: i * i }));
// A 100x50 grid of random ids (0..99)
const grid = Array.from({ length: ROWS }, () =>
Array.from({ length: COLS }, () => (Math.random() * N_ITEMS) | 0)
);
// Lookup tables
const byIdObj = Object.fromEntries(items.map(it => [it.id, it]));
const byIdMap = new Map(items.map(it => [it.id, it]));
// Prevent dead-code elimination
let checksum = 0;
function consume(v) { checksum = (checksum + (v?.value ?? 0)) | 0; }Ready to run.
| Test | Ops/sec | |
|---|---|---|
| .find over 100 items (5,000 times) | | ready |
| Object lookup table | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.