Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Lodash vs Native JS isEqual
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/119.0.0.0 Safari/537.36
Browser:
Chrome 119
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
Lodash lvl 1
2142975.0 Ops/sec
Native lvl 1
2094385.2 Ops/sec
Lodash lvl 2
1317470.0 Ops/sec
Native lvl 2
1163376.0 Ops/sec
Lodash lvl 3
944100.7 Ops/sec
Native lvl 3
776838.6 Ops/sec
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.4/lodash.min.js"></script>
Script Preparation code:
function isEqual(x, y) { const ok = Object.keys, tx = typeof x, ty = typeof y; return x && y && tx === 'object' && tx === ty ? ( ok(x).length === ok(y).length && ok(x).every(key => isEqual(x[key], y[key])) ) : (x === y); } // 1 level deep window.foo1 = { a: 1, b: 2, c: { a: 1, b: 2, c: { a: 1, b: 2 } } }; window.bar1 = { a: 1, b: 3, c: { a: 1, b: 2, c: { a: 1, b: 2 } } }; // 2 levels deep window.foo2 = { a: 1, b: 2, c: { a: 1, b: 2, c: { a: 1, b: 2 } } }; window.bar2 = { a: 1, b: 2, c: { a: 1, b: 3, c: { a: 1, b: 2 } } }; // 3 levels deep window.foo3 = { a: 1, b: 2, c: { a: 1, b: 2, c: { a: 1, b: 2 } } }; window.bar3 = { a: 1, b: 2, c: { a: 1, b: 2, c: { a: 1, b: 4 } } };
Tests:
Lodash lvl 1
_.isEqual(window.foo1, window.bar1)
Native lvl 1
isEqual(window.foo1, window.bar1)
Lodash lvl 2
_.isEqual(window.foo2, window.bar2)
Native lvl 2
isEqual(window.foo2, window.bar2)
Lodash lvl 3
_.isEqual(window.foo3, window.bar3)
Native lvl 3
isEqual(window.foo3, window.bar3)