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 isDeepEqual(objA, objB) {
// 1. Strict equality check for primitives and same object references
if (objA === objB) {
return true;
}
// 2. Check for null, undefined, or non-object types. If one is an object but the
// other isn't (or is null), they're not equal.
if (typeof objA !== 'object' || typeof objB !== 'object' || objA === null || objB === null) {
return false;
}
// 3. Compare the number of keys. If different, they can't be equal.
const keysA = Object.keys(objA);
const keysB = Object.keys(objB);
if (keysA.length !== keysB.length) {
return false;
}
// 4. Recursively compare the value of each key.
for (const key of keysA) {
if (!keysB.includes(key) || !this.isDeepEqual(objA[key], objB[key])) {
return false;
}
}
return true;
}
}
const data = {
"cmsName": "Main footer",
"banner": "<p>Share your thoughts, and help us improve the GBO Growth experience. <a href=\"https://forms.gle/xPk2NiKXymF9Tjjo6\" target=\"_blank\" rel=\"noopener\">Submit feedback</a></p>",
"links": [
{
"text": "About Google",
"url": "https://about.google/",
"openInNewTab": false,
"subNavItems": []
},
{
"text": "Google products",
"url": "https://about.google/products/",
"openInNewTab": false,
"subNavItems": []
},
{
"text": "Privacy",
"url": "https://policies.google.com/privacy",
"openInNewTab": false,
"subNavItems": []
},
{
"text": "Terms",
"url": "https://policies.google.com/terms",
"openInNewTab": false,
"subNavItems": []
}
],
"playbookCta": {
"ctaText": "User Guide",
"ctaUrl": "https://docs.google.com/presentation/d/1QNT6r3_dVxUepD7UcQLxO7HXti__g650FoA6BQT-I2Y/edit#slide=id.g30a43ad3772_0_0",
"openInNewTab": true
},
"disclaimerText": "<p><strong>Your journey, your data:</strong> The information you provide will be used only for personalizing your growth space experience, and will not be shared with others.<br />Learn more about our data policies or request your data be removed by contacting our <a href=\"mailto:gbo-growth-support@google.com\" target=\"_blank\" rel=\"noopener\">support team</a>.</p>",
"sitemapLinks": [
{
"text": "Home",
"url": "/",
"openInNewTab": false,
"subNavItems": [
{
"text": "Growth at GBO",
"url": "/growth-at-gbo",
"openInNewTab": false
},
{
"text": "GBO Assist",
"url": "/",
"openInNewTab": false
}
]
},
{
"text": "Growth Plan",
"url": "/growth-plan",
"openInNewTab": false,
"subNavItems": [
{
"text": "Learn",
"url": "/growth-plan#learn",
"openInNewTab": false
},
{
"text": "Connect",
"url": "/growth-plan#connect",
"openInNewTab": false
},
{
"text": "Explore",
"url": "/growth-plan#explore",
"openInNewTab": false
}
]
},
{
"text": "GBO Training",
"url": "/",
"openInNewTab": false,
"subNavItems": [
{
"text": "Aspiring Leaders",
"url": "/",
"openInNewTab": false
},
{
"text": "Leadership Plan",
"url": "/",
"openInNewTab": false
},
{
"text": "AI Fluency",
"url": "/",
"openInNewTab": false
}
]
},
{
"text": "My Growth Space",
"url": "/growth-space",
"openInNewTab": false,
"subNavItems": [
{
"text": "Career Development Plan",
"url": "/growth-space#career-development-plan",
"openInNewTab": false
},
{
"text": "Reflections",
"url": "/growth-space#reflections",
"openInNewTab": false
},
{
"text": "Personal Advisory Board",
"url": "/growth-space#personal-advisory-board",
"openInNewTab": false
},
{
"text": "Bookmarks",
"url": "/growth-space#bookmarks",
"openInNewTab": false
}
]
},
{
"text": "Community",
"url": "/growth-community",
"openInNewTab": false,
"subNavItems": [
{
"text": "Community",
"url": "/growth-community",
"openInNewTab": false
},
{
"text": "Career Stories",
"url": "/career-stories",
"openInNewTab": false
}
]
}
]
}Ready to run.
| Test | Ops/sec | |
|---|---|---|
| JSON.stringify | | ready |
| isDeepEqual | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.