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 ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
function randomString(length) {
const out = [];
for (let i = 0; i < length; i++) {
const randomChar = ALPHABET[Math.floor(Math.random() * ALPHABET.length)];
out.push(randomChar);
}
return out.join("");
}
function randomObject(size) {
const out = {};
for (let i = 0; i < size; i++) {
out[randomString(10)] = Math.random();
}
return out;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
object.keys |
| ready |
for-in |
| ready |
object.values |
| ready |
object.entries |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.