Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Lodash.get vs Dynamic path function
(version: 1)
Comparing performance of:
Lodash get vs Native
Created:
4 months ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/lodash/4.16.0/lodash.min.js"></script>
Script Preparation code:
var person = { name: { something: { else: 'Frederick' } }, lastName: 'Corcino Alejo' };
Tests:
Lodash get
_.get(person, 'name.something.else');
Native
function hasPropertyPath(obj, path) { const parts = path.split('.'); let current = obj; for (const part of parts) { if (current && typeof current === 'object' && part in current) { current = current[part]; } else { return false; } } return true; } hasPropertyPath(person, "name.something.else")
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Lodash get
Native
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
4 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0
Browser/OS:
Chrome 143 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Lodash get
5205089.0 Ops/sec
Native
6945252.5 Ops/sec
Related benchmarks:
lodash._get vs Property dot notation with native
Lodash.get vs safeGet vs Native
_,get vs get
lodash isEmpty vs ES6
lodash get vs native js
lodash get vs myget function
Lodash.get vs safeGet vs Native vs Native?
Lodash.get vs object-path vs Property dot notation vs Optional chaining
Lodash.get vs safeGet vs Null operator
Comments
Confirm delete:
Do you really want to delete benchmark?