Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Testing cloneDeep vs destructuring
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Browser:
Chrome 128
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
cloneDeep test
520963.1 Ops/sec
Destructuring test
2646446.5 Ops/sec
HTML Preparation code:
<script src=" https://cdn.jsdelivr.net/npm/lodash.clonedeep@4.5.0/index.min.js "></script>
Script Preparation code:
var button = { id: 'Test', icon: 'icon', }; var state = { id: 'State' }; var MyObject = { description: 'Creates a deep copy of source, which should be an object or an array.', myNumber: 123456789, myBoolean: true, buttons: [button], states: [state] }; var myCopy = null;
Tests:
cloneDeep test
myCopy = _.cloneDeep(MyObject);
Destructuring test
myCopy = {...MyObject, buttons: [button, ...MyObject.buttons], states: [MyObject.state]};