Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Lodash Set performance
(version: 1)
perf check vs simple implementation
Comparing performance of:
Lodash vs Simple
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js'></script>
Script Preparation code:
var obj = { a: { b: [ { c: 'Before' } ] } }; function setValue(obj, path, value) { var a = path.split('.') var o = obj while (a.length - 1) { var n = a.shift() if (!(n in o)) o[n] = {} o = o[n] } o[a[0]] = value } /*your preparation JavaScript code goes here To execute async code during the script preparation, wrap it as function globalMeasureThatScriptPrepareFunction, example:*/ async function globalMeasureThatScriptPrepareFunction() { // This function is optional, feel free to remove it. // await someThing(); }
Tests:
Lodash
_.set(obj, "a.b.0.c", "After");
Simple
setValue(obj, "a.b.0.c", "After");
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Lodash
Simple
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
10 months ago
)
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 19_0_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) GSA/372.0.765951532 Mobile/15E148 Safari/604.1
Browser/OS:
Mobile Safari 19 on iOS 19.0.0
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Lodash
7540182.0 Ops/sec
Simple
9563520.0 Ops/sec
Related benchmarks:
Underscore and Lodash: isEqual v2
Underscore vs Lodash: isEqual
lodash isEmpty vs ES6
for-in vs object.keys vs Ramda.mapObjIndexed
Underscore and Lodash: isEqual v4
Get object value by Path
Get object value by path vs lodash get
lodash isEmpty vs native ES6
lodash isEmpty vs native
Comments
Confirm delete:
Do you really want to delete benchmark?