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
Version of this test with a large object (100,000 key/value pairs)
var has = Object.prototype.hasOwnProperty;
var k, z = 100000, obj = {};
function randString()
{
var i, r, s = "";
for (i = 10; i--;)
{
r = Math.floor(Math.random() * 36);
s += String.fromCharCode((r < 10) ? r + 48 : r + 55);
}
}
while (z) if (!obj[k = randString()]) { obj[k] = k; z--; }
Ready to run.
Test | Ops/sec | |
---|---|---|
Array map with keys |
| ready |
Raw loop |
| ready |
Raw loop with cached .hasOwnProperty() |
| ready |
Using Object.keys |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.