Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Lodash Merge vs CloneDeep
(version: 2)
Merge into an empty object vs. deep cloning.
Comparing performance of:
Lodash merge() into {} vs Lodash cloneDeep()
Created:
7 months ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
let myCopy = null; const myObject = { description: 'Creates a deep copy of source, which should be an object or an array.', myNumber: 123456789, myBoolean: true, jayson: { stringify: 'JSON.stringify() method converts a JavaScript value to a JSON string....', parse: 'JSON.parse() method parses a JSON string...' } };
Tests:
Lodash merge() into {}
myCopy = _.merge({}, myObject);
Lodash cloneDeep()
myCopy = _.cloneDeep(myObject);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Lodash merge() into {}
Lodash cloneDeep()
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
7 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36
Browser/OS:
Chrome 140 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Lodash merge() into {}
2525997.2 Ops/sec
Lodash cloneDeep()
2215464.8 Ops/sec
Related benchmarks:
Lodash cloneDeep vs clone
Lodash cloneDeep vs JSON Clone vs Obj Clone
Lodash cloneDeep vs JSON Clone vs Ramda Clone
Lodash (4.17.11) cloneDeep vs JSON Clone
Lodash cloneDeep vs JSON parse+stringify
Lodash cloneDeep vs JSON Clone vs Lodash clone
Lodash cloneDeep vs JSON Clone vs Lodash clone 2
HY's Lodash cloneDeep vs JSON Clone vs Ramda Clone
Lodash (4.17.11) cloneDeep vs JSON Clone vs structuredClone
Comments
Confirm delete:
Do you really want to delete benchmark?