Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Lodash.isEqual vs JSON.stringify Equality Comparison for deep object
Test on isEqual performance
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Browser:
Chrome 130
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
_.isEqual
2494569.5 Ops/sec
JSON.stringify
622105.4 Ops/sec
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.15/lodash.min.js"></script>
Script Preparation code:
window.foo = { "general": { "patientMaritalStatus": { "status": "MARITAL_STATUS_P_SINGLE", "note": "Test note" }, "patientWorkStatus": { "status": "WORK_STATUS_P_RETIRED", "note": "Another note" } }, "substanceAbuse": { "alcoholUse": { "usedFrequency": "USED_FREQUENCY_P_CURRENT_SOME_DAYS", "ageAtStart": 40 } } }; window.bar = { "general": { "patientMaritalStatus": { "status": "MARITAL_STATUS_P_MARRIED", "note": "Test note" }, "patientWorkStatus": { "note": "Updated note" }, "newField": "Added field" }, "substanceAbuse": { "alcoholUse": { "usedFrequency": "USED_FREQUENCY_P_NEVER", "ageAtStart": 40 } }, "miscellaneous": { "children": { "answer": "THREE_STATE_ANSWER_P_YES" }, "militaryService": { "answer": "THREE_STATE_ANSWER_P_NO" }, "legalCases": { "answer": "THREE_STATE_ANSWER_P_NO" }, "otherSocialHistory": { "answer": "THREE_STATE_ANSWER_P_NO" }, "physicalImpairments": { "answer": "THREE_STATE_ANSWER_P_YES" }, "socialOrFinancialConcerns": { "answer": "THREE_STATE_ANSWER_P_NO" }, "subSectionStatus": "SUB_SECTION_STATUS_P_VALID" }, "familyHistory": [ { "familyHistoryItem": { "historyItemId": "66abea5c9806da604760f933", "name": "Cancer (Colon)", "icdCode": "", "altSystem": "" }, "familyMembers": [ { "relation": "FAMILY_MEMBER_RELATION_P_UNCLE", "ageAtOnset": 50 } ], "subSectionStatus": "SUB_SECTION_STATUS_P_VALID" } ] } ;
Tests:
_.isEqual
_.isEqual(window.foo, window.bar)
JSON.stringify
JSON.stringify(window.foo) === JSON.stringify(window.bar);