Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Lodash cloneDeep vs structuredClone with sets & maps
(version: 1)
https://developer.mozilla.org/en-US/docs/Web/API/structuredClone
Comparing performance of:
Lodash cloneDeep vs Native structuredClone
Created:
3 months ago
by:
Guest
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:
var MyObject = { description: 'Creates a deep copy of source, which should be an object or an array.', myNumber: 123456789, myBoolean: true, mySet: new Set([123, 'foo']), myMap: new Map([['a', {}], ['b', {}]]), jayson: { stringify: 'JSON.stringify() method converts a JavaScript value to a JSON string....', parse: 'JSON.parse() method parses a JSON string...' } }; var myCopy = null;
Tests:
Lodash cloneDeep
myCopy = _.cloneDeep(MyObject);
Native structuredClone
myCopy = structuredClone(MyObject);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Lodash cloneDeep
Native structuredClone
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
3 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36
Browser/OS:
Chrome 140 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Lodash cloneDeep
267458.0 Ops/sec
Native structuredClone
302102.0 Ops/sec
Related benchmarks:
Lodash cloneDeep vs structuredClone vs recursiveDeepCopy vs JSON clone 10kb json
Lodash cloneDeep vs structuredClone with array values
Lodash cloneDeep vs structuredClone vs JSON.stringify with array values
Lodash cloneDeep vs structuredClone with map and hashset
Lodash cloneDeep vs structuredClone vs JSON-JSON
Lodash cloneDeep vs structuredClone on many
Lodash cloneDeep vs structuredClone on lots
Lodash cloneDeep vs structuredClone vs JSON Parse (100 000 objects)
Lodash cloneDeep vs structuredClone big 123123123
Comments
Confirm delete:
Do you really want to delete benchmark?