Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
CloneDeep BenchMarks
(version: 0)
Comparing performance of:
Lodash cloneDeep vs Stringify
Created:
4 years 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 o = {"ObjectHomePageProd":[{"x":1,"y":1,"w":100,"h":5,"i":"object-home-page-template-page-header","comp":"ObjectHomePageHeader","moved":"__vue_devtool_undefined__"},{"x":1,"y":6,"w":100,"h":26,"i":"object-home-page-template-content-panel","comp":"ObjectMultiContentPanel","config":{"availableLists":[{"listName":"ProdList","text":"Products"},{"listName":"PrceList","text":"Prices"}]},"moved":"__vue_devtool_undefined__"}],"PageHeader":[{"comp":"LayoutFlex","i":"layout-def","itemConfig":{"isHidden":true},"static":2,"config":{"columns":["0","1","2","3","4","5"]}},{"i":"0","comp":"PageLauncher","itemConfig":{"class":"page-header-launcher","shrink":"0"}},{"i":"1","comp":"PageHeaderCompanyLogo","itemConfig":{"class":"page-header-company-logo","shrink":"0"}},{"i":"2","itemConfig":{"isSpace":true}},{"i":"3","comp":"PageHeaderSearchBar","itemConfig":{"class":"page-header-search-bar d-flex align-items-center p-i-sm","grow":"1"},"config":{"advancedFilterLayoutName":"ObjectAdvancedFilterForGlobalSearch","entitiesToFilter":[{"name":"Company"},{"name":"Contact"},{"name":"Opportunity"},{"name":"Project"},{"name":"Request"}],"minStringLength":2,"minWaitingTime":0.7,"quantityElementsInSearch":5,"quantityMoreResults":25,"separator":", "}},{"i":"4","comp":"PageHeaderActionBar","itemConfig":{"class":"page-header-action-bar d-flex","shrink":"0"}},{"i":"5","comp":"PageHeaderUserProfile","itemConfig":{"class":"page-header-user-profile d-flex align-items-center p-i-s-sm p-i-e-ty","shrink":"0"}}],"PageMainMenu":[{"comp":"LayoutFlex","i":"layout-def","itemConfig":{"isHidden":true},"static":2,"config":{"columns":["1","0","2","3","5","4","7"]}},{"comp":"PageMainMenuItemFavorites","i":"1","itemConfig":{"isHidden":true},"static":2,"config":{"icon":"star","title":"Favorites"}},{"comp":"PageMainMenuItemShortcut","i":"0","static":2,"config":{"icon":"arrow-up-right-from-square","title":"Shortcuts"}},{"comp":"PageMainMenuItemObject","i":"2","config":{"link":"/homepage/Comp/list","title":"Companies","crmObject":"Comp"}},{"comp":"PageMainMenuItemObject","i":"3","config":{"link":"/homepage/Cont/list","title":"Contacts","crmObject":"Cont"}},{"comp":"PageMainMenuItemObject","i":"5","config":{"link":"/homepage/Oppo/list","title":"Opportunities","crmObject":"Oppo"}},{"comp":"PageMainMenuItemObject","i":"4","config":{"link":"/homepage/Quer/list","title":"Query","crmObject":"Quer"}},{"comp":"PageMainMenuItemObject","i":"6","config":{"link":"/homepage/Tmpl/list","title":"Template","crmObject":"tmpl"}},{"comp":"PageMainMenuItemObject","i":"7","config":{"link":"/homepage/Prod/list","title":"Product","crmObject":"prod"}}],"ObjectHomePageHeaderProd":[{"comp":"ObjectTitle","x":0,"y":0,"w":0,"h":0,"i":"1","config":{"defaultTitle":"Product Catalogue"}},{"x":0,"y":0,"w":0,"h":0,"i":"2","comp":"LayoutFlex","config":{"gap":"sm","layoutName":"ObjectHomePageProdMainActionButtons"}}],"ObjectHomePageProdMainActionButtons":[{"comp":"ObjectMainEditionButton","x":0,"y":0,"w":0,"h":0,"i":"2","config":{"name":"new","text":"New","tooltip":"New","icon":"plus"}},{"comp":"ObjectMoreButton","x":0,"y":0,"w":0,"h":0,"i":"4","config":{"options":[{"id":"2","text":"Option1","action":"action1","isPinnable":true,"pinned":false},{"id":"3","text":"Option2","action":"action2","isPinnable":true,"pinned":true}]}}],"RenderEntities":[{"i":"default","config":{"Company":{"fields":{"picture":"compPicture","name":["data.name"],"tag":"type","details":["category.address.street"]}},"Contact":{"fields":{"picture":"contPicture","name":["data.firstName","data.name"],"tag":"data.jobTitle","details":["relation.company.main.compName"]}},"Opportunity":{"fields":{"name":["data.name"],"tag":"data.tag","details":["data.budgetConsolidated","relation.company.main.compName"]}},"Project":{"fields":{"name":["data.name"],"tag":"data.tag","details":["relation.contact.name","relation.contact.firstName"]}},"Query":{"fields":{"name":["data.name"],"tag":"","details":[]}},"Request":{"fields":{"name":["data.name"],"tag":"data.rqstTag","details":["relation.contact.main.contName","relation.contact.main.contFirstName"]}},"Appointment":{"fields":{"name":["data.subject"],"tag":"data.appoPlanned","details":["relation.contact.main.contName","relation.contact.main.contFirstName"]}},"Address":{"fields":{"name":["data.name"],"tag":"data.countryCode","details":["data.road","data.doorNumber"]}},"BusinessFlow":{"fields":{"name":["data.name"],"tag":"","details":[]}},"Template":{"fields":{"name":["data.name","data.subject"],"tag":"data.server","details":[]}}}}]}
Tests:
Lodash cloneDeep
const a = _.cloneDeep(o)
Stringify
const a = JSON.parse(JSON.stringify(o))
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Lodash cloneDeep
Stringify
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
**Benchmark Overview** The provided JSON represents a benchmark test case for measuring the performance of two different JavaScript cloning libraries: Lodash's `cloneDeep` and stringification using `JSON.parse(JSON.stringify(o))`. The benchmark tests the speed of these operations on a large, complex object graph represented by the `o` variable. **Benchmark Definitions** There are only two individual test cases: 1. **Lodash cloneDeep**: This test case measures the performance of Lodash's `cloneDeep` function in cloning the `o` object. * The benchmark definition is `const a = _.cloneDeep(o)`. 2. **Stringify**: This test case measures the performance of stringifying the `o` object using `JSON.parse(JSON.stringify(o))`. * The benchmark definition is `const a = JSON.parse(JSON.stringify(o))`. **Options Compared** The two options being compared are: 1. **Lodash cloneDeep**: A library-based cloning function that creates a deep copy of the original object. 2. **Stringify**: A built-in JavaScript function that uses stringification to create a copy of the original object. **Performance Metrics** The benchmark results provide several performance metrics for each test case, including: 1. **RawUAString**: The User Agent string of the browser executing the benchmark. 2. **Browser**: The name and version of the browser used to execute the benchmark. 3. **DevicePlatform**: The device platform (desktop or mobile) used to execute the benchmark. 4. **OperatingSystem**: The operating system used to execute the benchmark. 5. **ExecutionsPerSecond**: The number of executions per second for each test case. **Benchmark Results** The latest benchmark result is provided in two entries: 1. **Stringify**: 19250.828125 executions/second (Chrome 100, Desktop, Windows) 2. **Lodash cloneDeep**: 11219.431640625 executions/second (Chrome 100, Desktop, Windows) Overall, the results suggest that Lodash's `cloneDeep` function is slower than stringification for this specific use case. **Conclusion** The benchmark test case measures the performance of two different JavaScript cloning libraries: Lodash's `cloneDeep` and stringification using `JSON.parse(JSON.stringify(o))`. The results indicate that stringification is faster than Lodash's `cloneDeep` function, likely due to the overhead introduced by the library.
Related benchmarks:
ES6 vs Lodash object copying
is lodash cloneDeep the BEST object deep cloner ? what about native structuredClone function ?
Object Clone Lodash vs structuredClone
JS Cloning benchmarking
Lodash cloneDeep vs JSON parse
Comments
Confirm delete:
Do you really want to delete benchmark?