Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
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 (Macintosh; Intel Mac OS X 10.15; rv:130.0) Gecko/20100101 Firefox/130.0
Browser:
Firefox 130
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
Destructuring test
12.6M/s
cloneDeep test
810K/s
View exact numbers
Test name
Executions per second
✓
Destructuring test
12,645,255 Ops/sec
cloneDeep test
810,358 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]};