Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
lodash cloneDeep vs structuredClone on larger object and with arrays
(version: 0)
as in name
Comparing performance of:
lodash vs structuredClone
Created:
one year ago
by:
Guest
Jump to the latest result
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": 58, "windows": [ { "id": 84, "locations": [ { "id": 101, "type": { "id": 1, "name": "LMS" }, "clli": "1233535-WERER", "city": "Try", "state": "UG", "updateTime": "2024-05-19T03:41:16.828181Z", "updateUser": "me@me.com" }, { "id": 123, "type": { "id": 2, "name": "Non-Site Location of Work" }, "clli": "686868-JKIJ", "city": "Rome", "state": "Italy", "updateTime": "2024-05-16T03:44:21.027202Z", "updateUser": "me@me.com" } ], "state": { "id": 2, "name": "WIP" }, "windowName": "Window-11", "windowStartDate": "2024-05-16T04:51:53Z", "windowEndDate": "2024-05-17T04:51:56Z", "previousStartDate": null, "previousEndDate": null, "windowDuration": 86403, "alternateNight": false, "completionCodeLevel1": null, "completionCodeLevel2": null, "completionCodeLevel3": null, "updateTime": "2024-05-20T07:56:12.645614Z", "updateUser": "gurpal.kundi-p@brightspeed.com" } ], "affectedObjectName": "ao-09876", "legacyNetwork": "lumen", "unprotectedOutageDurationMs": 68, "unprotectedOutageDurationType": "MS", "protectedOutageDurationMs": 64, "protectedOutageDurationType": "MS", "updateTime": "2024-05-19T06:52:59.404136Z", "updateUser": "me@me.com", "_links": { "self": { "href": "/gcrservices/api/ticketAffectedObjects/58" }, "ticketAffectedObject": { "href": "/gcrservices/api/ticketAffectedObjects/58" }, "ticketWindows": { "href": "/gcrservices/api/ticketAffectedObjects/58/ticketWindows" }, "ticketServiceImpacts": { "href": "/gcrservices/api/ticketAffectedObjects/58/ticketServiceImpacts" }, "ticket": { "href": "/gcrservices/api/ticketAffectedObjects/58/ticket" } } }, { "id": 59, "windows": [ { "id": 85, "locations": [ { "id": 101, "type": { "id": 1, "name": "LMS" }, "clli": "1233535-WERER", "city": "Try", "state": "UG", "updateTime": "2024-05-19T03:41:16.828181Z", "updateUser": "me@me.com" }, { "id": 100, "type": { "id": 1, "name": "LMS" }, "clli": "12345-uhj3454", "city": "Bit", "state": "LO", "updateTime": "2024-05-16T03:43:50.083512Z", "updateUser": "me@me.com" } ], "state": { "id": 1, "name": "New" }, "windowName": "Window-11b", "windowStartDate": "2024-05-29T04:52:41Z", "windowEndDate": "2024-05-30T04:52:43Z", "previousStartDate": null, "previousEndDate": null, "windowDuration": 86402, "alternateNight": false, "completionCodeLevel1": null, "completionCodeLevel2": null, "completionCodeLevel3": null, "updateTime": "2024-05-20T05:02:39.836078Z", "updateUser": "gurpal.kundi-p@brightspeed.com" } ], "affectedObjectName": "ao-09876", "legacyNetwork": "lumen", "unprotectedOutageDurationMs": 68, "unprotectedOutageDurationType": "MS", "protectedOutageDurationMs": 64, "protectedOutageDurationType": "MS", "updateTime": "2024-05-19T06:53:05.105813Z", "updateUser": "me@me.com", "_links": { "self": { "href": "/gcrservices/api/ticketAffectedObjects/59" }, "ticketAffectedObject": { "href": "/gcrservices/api/ticketAffectedObjects/59" }, "ticketWindows": { "href": "/gcrservices/api/ticketAffectedObjects/59/ticketWindows" }, "ticketServiceImpacts": { "href": "/gcrservices/api/ticketAffectedObjects/59/ticketServiceImpacts" }, "ticket": { "href": "/gcrservices/api/ticketAffectedObjects/59/ticket" } } }, { "id": 60, "windows": [ { "id": 86, "locations": [ { "id": 100, "type": { "id": 1, "name": "LMS" }, "clli": "12345-uhj3454", "city": "Bit", "state": "LO", "updateTime": "2024-05-16T03:43:50.083512Z", "updateUser": "me@me.com" } ], "state": { "id": 1, "name": "New" }, "windowName": "Window-12", "windowStartDate": "2024-05-20T14:57:54Z", "windowEndDate": "2024-05-21T14:57:59Z", "previousStartDate": null, "previousEndDate": null, "windowDuration": 86405, "alternateNight": true, "completionCodeLevel1": null, "completionCodeLevel2": null, "completionCodeLevel3": null, "updateTime": "2024-05-16T14:58:11.538215Z", "updateUser": "Gurpal.Kundi@brightspeed.com" } ], "affectedObjectName": "ao-1234111", "legacyNetwork": "spectrum", "unprotectedOutageDurationMs": 540000, "unprotectedOutageDurationType": "MIN", "protectedOutageDurationMs": 65444, "protectedOutageDurationType": "MS", "updateTime": "2024-05-19T06:53:09.671428Z", "updateUser": "me@me.com", "_links": { "self": { "href": "/gcrservices/api/ticketAffectedObjects/60" }, "ticketAffectedObject": { "href": "/gcrservices/api/ticketAffectedObjects/60" }, "ticketWindows": { "href": "/gcrservices/api/ticketAffectedObjects/60/ticketWindows" }, "ticketServiceImpacts": { "href": "/gcrservices/api/ticketAffectedObjects/60/ticketServiceImpacts" }, "ticket": { "href": "/gcrservices/api/ticketAffectedObjects/60/ticket" } } }, { "id": 61, "windows": [ { "id": 84, "locations": [ { "id": 101, "type": { "id": 1, "name": "LMS" }, "clli": "1233535-WERER", "city": "Try", "state": "UG", "updateTime": "2024-05-19T03:41:16.828181Z", "updateUser": "me@me.com" }, { "id": 123, "type": { "id": 2, "name": "Non-Site Location of Work" }, "clli": "686868-JKIJ", "city": "Rome", "state": "Italy", "updateTime": "2024-05-16T03:44:21.027202Z", "updateUser": "me@me.com" } ], "state": { "id": 2, "name": "WIP" }, "windowName": "Window-11", "windowStartDate": "2024-05-16T04:51:53Z", "windowEndDate": "2024-05-17T04:51:56Z", "previousStartDate": null, "previousEndDate": null, "windowDuration": 86403, "alternateNight": false, "completionCodeLevel1": null, "completionCodeLevel2": null, "completionCodeLevel3": null, "updateTime": "2024-05-20T07:56:12.645614Z", "updateUser": "gurpal.kundi-p@brightspeed.com" } ], "affectedObjectName": "ao-8232323", "legacyNetwork": "nice", "unprotectedOutageDurationMs": 7200000, "unprotectedOutageDurationType": "HRS", "protectedOutageDurationMs": 180000, "protectedOutageDurationType": "MIN", "updateTime": "2024-05-19T06:53:18.271138Z", "updateUser": "me@me.com", "_links": { "self": { "href": "/gcrservices/api/ticketAffectedObjects/61" }, "ticketAffectedObject": { "href": "/gcrservices/api/ticketAffectedObjects/61" }, "ticketWindows": { "href": "/gcrservices/api/ticketAffectedObjects/61/ticketWindows" }, "ticketServiceImpacts": { "href": "/gcrservices/api/ticketAffectedObjects/61/ticketServiceImpacts" }, "ticket": { "href": "/gcrservices/api/ticketAffectedObjects/61/ticket" } } } ] var myCopy = null;
Tests:
lodash
myCopy = _.cloneDeep(MyObject);
structuredClone
myCopy = structuredClone(MyObject);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
lodash
structuredClone
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Browser/OS:
Chrome 124 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
lodash
18389.0 Ops/sec
structuredClone
17062.3 Ops/sec
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
It seems like you're trying to analyze the given JSON data and benchmark results, but there's no clear question or task that requires a specific answer. However, I'll attempt to help you by extracting some relevant information. From the provided JSON data: * The object `MyObject` is not defined in the snippet, but it seems to contain various properties such as `id`, `type`, `clli`, `city`, `state`, etc. * The `_links` property contains several links related to the ticket affected object. * There's also a `myCopy` variable assigned a JSON string, which might be used in the benchmarking tests. From the benchmark results: * Two test cases are listed: "lodash" and "structuredClone". These functions are likely being compared for their performance when cloning or deep copying objects like `MyObject`. * The latest benchmark result shows two objects with different execution rates per second (18388.9765625 and 17062.310546875) for the "lodash" test case. * It's also mentioned that there are raw UA strings, browsers, device platforms, operating systems, etc., but these seem to be irrelevant to the actual question. Without more context or a specific task, I'll assume you want me to help with something like: * Identifying the properties of `MyObject` in the provided JSON data. * Understanding how `_links` works in this context. * Helping with interpreting or visualizing the benchmark results (e.g., what's happening between "lodash" and "structuredClone"?). Please let me know if I'm correct, or if you have a specific question or task in mind!
Related benchmarks:
Object Clone Lodash vs structuredClone
Lodash cloneDeep vs structuredClone vs JSON.stringify (small object)
Lodash cloneDeep vs JSON Clone vs Ramda Clone for big Array
Lodash cloneDeep vs JSON parse
Lodash cloneDeep vs native cloneDeep fdasfff
Comments
Confirm delete:
Do you really want to delete benchmark?