Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Lodash Set performance
perf check vs simple implementation
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/134.0.0.0 Safari/537.36
Browser:
Chrome 134
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Lodash
8504602.0 Ops/sec
Simple
14825271.0 Ops/sec
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");