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 iota = n =>
Array.from(Array(n), (_, i) => i);
const KINDS = ["a", "b", "c", "d"];
const randomString = n => [...crypto.getRandomValues(new Uint8Array(n))]
.map(String.fromCharCode)
.join("");
const roll = n => Math.floor(Math.random() * n)
const toThing = id => {
const name = randomString(12)
const kind = KINDS[roll(KINDS.length)]
return { id, name, kind }
}
const things = iota(100000).map(toThing);
const selected = KINDS[roll(KINDS.length)];Ready to run.
| Test | Ops/sec | |
|---|---|---|
| Reduce | | ready |
| filter and map | | ready |
| flatMap | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.