Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
lodash clonedeep vs json.parse(stringify())
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/140.0.0.0 Safari/537.36 Edg/140.0.0.0
Browser:
Chrome 140
Operating system:
Windows
Device Platform:
Desktop
Date tested:
3 months ago
Test name
Executions per second
Lodash CloneDeep
50966.2 Ops/sec
Json Clone
80624.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 = [{ "id": 62, "name": "option 1 test", "address": { "id": 62, "name": null, "addressLine2": null, "addressLine1": null, "city": "LONDON", "country": null, "postal": null, "latitude": null, "longitude": null, "description": null, "transport": [{ "id": 2, "description": "instrcution bus 1", "type": "BUS" }], "contact": "", "media": [{ "id": 97, "url": "https://headout-test.s3.us-west-2.amazonaws.com/media/Nitisha Chhatwani Resume (1)-2 (2).pdf" }, { "id": 98, "url": "https://headout-test.s3.us-west-2.amazonaws.com/media/Nitisha Chhatwani Resume (1)-2 (2).pdf" }, { "id": 99, "url": "https://headout-test.s3.us-west-2.amazonaws.com/media/Nitisha Chhatwani Resume (1)-2 (2).pdf" }, { "id": 100, "url": "https://headout-test.s3.us-west-2.amazonaws.com/media/Nitisha Chhatwani Resume (1)-2 (2).pdf" }, { "id": 101, "url": "https://headout-test.s3.us-west-2.amazonaws.com/media/Nitisha Chhatwani Resume (1)-2 (2).pdf" } ] }, "redemptionAddress": null, "referenceCode": null, "inclusions": [], "exclusions": [], "hotelTransfer": null, "hotels": null, "isCancellable": null, "canReschedule": null, "isRedemptionMeetingPointSame": null, "offlineRedemption": null, "fulfilmentType": null, "freesaleOptionSetting": null, "apiOptionSetting": null, "onRequestOptionSetting": null, "portalOptionSetting": null, "periodType": null, "periodDurationHours": 0, "periodDurationMinutes": 0, "cancellationDuration": null, "rescheduleDuration": null, "paxSettings": [{ "id": 2, "ageFrom": 1, "ageTo": 2, "description": "", "paxType": "INFANT" }] }, { "id": 136, "name": null, "address": { "id": 142, "name": null, "addressLine2": null, "addressLine1": null, "city": "LONDON", "country": null, "postal": null, "latitude": null, "longitude": null, "description": null, "transport": [], "contact": "", "media": [] }, "redemptionAddress": null, "referenceCode": null, "inclusions": [], "exclusions": [], "hotelTransfer": null, "hotels": null, "isCancellable": null, "canReschedule": null, "isRedemptionMeetingPointSame": null, "offlineRedemption": null, "fulfilmentType": null, "freesaleOptionSetting": null, "apiOptionSetting": null, "onRequestOptionSetting": null, "portalOptionSetting": null, "periodType": null, "periodDurationHours": 0, "periodDurationMinutes": 0, "cancellationDuration": null, "rescheduleDuration": null, "paxSettings": [{ "id": 63, "ageFrom": 1, "ageTo": 2, "description": "", "paxType": "INFANT" }] } ]; var myCopy = null;
Tests:
Lodash CloneDeep
myCopy = _.cloneDeep(MyObject);
Json Clone
myCopy = JSON.parse(JSON.stringify(MyObject));