Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Lodash.isEqual vs JSON.stringify Equality Comparison for deep nested obj
(version: 1)
Test on isEqual performance
Comparing performance of:
_.isEqual vs JSON.stringify
Created:
9 months ago
by:
Guest
Go to the latest result
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.4/lodash.min.js"></script>
Script Preparation code:
window.foo = {arr:[{nmr: 1,str: "string" }], obj:{ someField: 'string', nested:{more:[{arrg: 123, str:"string"}]}}}; window.bar = {arr:[{nmr: 1,str: "string" }], obj:{ someField: 'string', nested:{more:[{arrg: 123, str:"string"}]}}}
Tests:
_.isEqual
_.isEqual(window.foo, window.bar)
JSON.stringify
JSON.stringify(window.foo) === JSON.stringify(window.bar);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
_.isEqual
JSON.stringify
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
9 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36
Browser/OS:
Chrome 141 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
JSON.stringify
3.6M/s
_.isEqual
596K/s
View exact numbers
Test name
Executions per second
✓
JSON.stringify
3,564,677 Ops/sec
_.isEqual
595,594 Ops/sec
Related benchmarks
Lodash.isEqual vs JSON.stringify Equality Comparison for Shallow Array of Strings.
Lodash.isEqual vs JSON.stringify Equality Comparison for deep objects.
Lodash.isEqual vs JSON.stringify Equality Comparison for Shallow Array of Strings vs ===
Comments
Confirm delete:
Do you really want to delete benchmark?