Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Lodash cloneDeep VS spread operator vs structured clone on complex object
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/143 Mobile/15E148 Version/17.7
Browser:
Mobile Safari 17
Operating system:
iOS 18.7
Device Platform:
Mobile
Date tested:
3 months ago
Test name
Executions per second
Lodash cloneDeep
154242.9 Ops/sec
Spread operator
17105452.0 Ops/sec
structuredClone
69633.2 Ops/sec
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 = { "name": "John Doe", "age": 30, "isStudent": false, "address": { "street": "123 Main St", "city": "Anytown", "zipcode": "12345" }, "contacts": [ { "type": "email", "value": "john.doe@example.com" }, { "type": "phone", "value": "+1 123-456-7890" } ], "skills": { "programming": ["JavaScript", "Python", "Java"], "design": ["Photoshop", "Illustrator"], "languages": { "spoken": ["English", "Spanish"], "written": ["English", "French"] } }, "isActive": true, "projects": [ { "name": "Project A", "status": "completed", "team": ["Alice", "Bob"] }, { "name": "Project B", "status": "in progress", "team": ["Charlie", "David"] } ] }; var myCopy = null;
Tests:
Lodash cloneDeep
myCopy = _.cloneDeep(MyObject);
Spread operator
myCopy = {...MyObject};
structuredClone
myCopy = structuredClone(MyObject);