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
I found that creation of keys up to 10 million members was linear, no noticeable performance hit in Chrome. I decided that a better test however would be comparison of CRUD operations on a filled "Hash" of 1 million.
//I would really only like to run fill hash once ever
var hash = hash || {},
n = 100000,
random = Math.floor((Math.random() * n) + 1),
variableName = "name" + random,
otherName = "other" + random;
function fill(n) {
var i = 0;
for (i; i < n; i++) {
hash["name" + i] = i;
}
}
if (typeof hash.name100 === "undefined") {
fill(n);
}
random = Math.floor((Math.random() * n) + 1);
variableName = "name" + random;
otherName = "other" + random;
Ready to run.
Test | Ops/sec | |
---|---|---|
Create |
| ready |
Read |
| ready |
Update |
| ready |
Destroy |
| ready |
Control |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.