Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Lodash deep clone vs JSON parse stringify
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:140.0) Gecko/20100101 Firefox/140.0
Browser:
Firefox 140
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
9 months ago
Test name
Executions per second
JSON
1453626.2 Ops/sec
clone deep
463704.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:
window.dater = { name: 'test', arr: [1, 2, 3, 4, 5], innerObj: { name: 'Test Inner', innerArr: [2, 4, 5, 6], isDeleted: false, }, sigh: true, };
Tests:
JSON
const res = JSON.parse(JSON.stringify(window.dater))
clone deep
const result = _.cloneDeep(window.dater)