Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
optional chaining vs lodash get
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:137.0) Gecko/20100101 Firefox/137.0
Browser:
Firefox 137
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
one year ago
optional chain
561.3M/s
lodash get with array
22.4M/s
lodash get with string
9.0M/s
View exact numbers
Test name
Executions per second
✓
optional chain
561,281,344 Ops/sec
lodash get with array
22,408,844 Ops/sec
lodash get with string
9,038,266 Ops/sec
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
var obj = {a: {b: {c: {d: 1}}}}
Tests:
optional chain
obj?.a?.b?.c?.d
lodash get with array
_.get(obj, ['a','b','c','d'])
lodash get with string
_.get(obj, 'a.b.c.d')