Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Lodash cloneDeep vs structuredClone vs JSON.stringify/parse 2
(version: 1)
https://developer.mozilla.org/en-US/docs/Web/API/structuredClone
Comparing performance of:
Lodash cloneDeep vs Native structuredClone vs JSON.stringify / parse
Created:
4 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:
const data = { id: crypto.randomUUID(), timestamp: new Date(), nested: { numbers: Array.from({ length: 1000 }, (_, i) => i), text: "Some sample text content ".repeat(10), tags: new Set(['performance', 'benchmark', '2025']), mapping: new Map([['key1', 'val1'], ['key2', 'val2']]) } };
Tests:
Lodash cloneDeep
_.cloneDeep(data);
Native structuredClone
structuredClone(data);
JSON.stringify / parse
myCopy = JSON.parse(JSON.stringify(data));
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Lodash cloneDeep
Native structuredClone
JSON.stringify / parse
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
Browser/OS:
Chrome 143 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Lodash cloneDeep
26430.2 Ops/sec
Native structuredClone
54009.5 Ops/sec
JSON.stringify / parse
64495.6 Ops/sec
Related benchmarks:
Lodash cloneDeep vs structuredClone vs recursiveDeepCopy vs JSON clone more complex object
Lodash cloneDeep vs structuredClone with array values
Lodash cloneDeep vs structuredClone vs JSON.stringify with array values
Lodash cloneDeep vs structuredClone vs naive JSON.stringify
Lodash cloneDeep vs structuredClone with map and hashset
Lodash cloneDeep vs structuredClone vs naive JSON.stringify vs produce
Lodash cloneDeep vs structuredClone 2222
Lodash cloneDeep vs structuredClone 22222
Lodash cloneDeep vs structuredClone big 123123123
Comments
Confirm delete:
Do you really want to delete benchmark?