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
function deepEquals(...o) {
if (o.length <= 1) return true;
for (let index = 1; index < o.length; index++) {
if (!_deepEquals(o[0], o[index])) return false;
}
return true;
}
function _deepEquals(o1, o2) {
if (o1 === o2) return true;
if ((o1 && !o2) || (o2 && !o1)) return false;
if (typeof o1 !== typeof o2) return false;
if (typeof o1 !== "object") return false;
// Objects can have different keys if the values are undefined
for (const key in o2) {
if (!(key in o1) && o2[key] !== undefined) {
return false;
}
}
for (const key in o1) {
if (typeof o1[key] !== typeof o2[key]) return false;
if (typeof o1[key] === "object") {
if (!_deepEquals(o1[key], o2[key])) return false;
} else {
if (o1[key] !== o2[key]) return false;
}
}
return true;
}
Ready to run.
| Test | Ops/sec | |
|---|---|---|
| test1 | | ready |
| test2 | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.