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_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5.2 Safari/605.1.15
Browser:
Safari 16
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
2 years ago
optional chain
29.7M/s
lodash get with array
10.6M/s
lodash get with string
6.3M/s
View exact numbers
Test name
Executions per second
✓
optional chain
29,667,408 Ops/sec
lodash get with array
10,567,580 Ops/sec
lodash get with string
6,263,301 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')