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 data = {};
const chars = "abcdefghijklmnopqrstuvwxyz";
for (let i = 0; i < 1000; i++) {
let name;
do {
name = "";
for (let j = 0; j < 32; j++) {
name += chars[Math.floor(Math.random() * 26)];
}
} while (data[name] != null);
data[name] = Math.random();
}
if (Object.keys(data).length !== 1000) throw new TypeError( "bad setup" );Ready to run.
| Test | Ops/sec | |
|---|---|---|
| for-in loop | | ready |
| for-of loop on keys | | ready |
| for-of loop on values | | ready |
| for-of loop on entries | | ready |
| reduce on keys w/ arrow function | | ready |
| reduce on values w/ arrow function | | ready |
| legacy for loop on keys | | ready |
| legacy for loop on values | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.