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
Wether a combined key is faster than individual object lookups.
<script>
var data1 = {};
for (var x = 0; x < 10; x++) {
data1[x] = {};
for (var y = 0; y < 10; y++) {
data1[x][y] = {};
for (var z = 0; z < 10; z++) {
data1[x][y][z] = x + y + z;
}
}
}
var data2 = {};
for (var x = 0; x < 10; x++) {
for (var y = 0; y < 10; y++) {
for (var z = 0; z < 10; z++) {
data2[x + "x" + y + "x" + z] = x + y + z;
}
}
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Multi Key Lookup |
| ready |
Combined Key Lookup |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.