Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
my deep clone - lodash vs ramda vs json
(version: 0)
Comparing performance of:
lodash - cloneDeep vs json - parse/stringify vs ramda - clone
Created:
7 years ago
by:
Registered User
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 src="https://cdnjs.cloudflare.com/ajax/libs/ramda/0.25.0/ramda.min.js"></script>
Script Preparation code:
var obj = { "type": "report", "label": "Collection Report", "version": "1.0", "children": [ { "type": "section", "label": "collection", "children": [ { "type": "subsection", "label": "collection", "children": [ { "type": "collection", "children": [ { "type": "row", "children": [ { "type": "textField", "label": "Text", "mdWidth": 50, "contentPath": "text" }, { "type": "singlePickerButton", "label": "Options", "mdWidth": 25, "options": [ { "title": "Show", "identifier": "show" }, { "title": "Hide", "identifier": "hide" } ], "contentPath": "option" }, { "type": "removeButton", "label": "", "title": "Remove Item", "mdWidth": 25 } ] } ], "contentPath": "collection" }, { "type": "row", "children": [ { "type": "column", "mdWidth": 75 }, { "type": "addButton", "title": "Add Item", "mdWidth": 25, "mdPadding": { "top": 0.5, "bottom": 0.5 }, "contentPath": "collection" } ] } ] }, { "type": "subsection", "label": "showItemIfValue equals:show", "children": [ { "type": "collection", "children": [ { "type": "row", "children": [ { "type": "textField", "label": "Text", "enabled": false, "mdWidth": 100, "contentPath": "text" } ] } ], "contentPath": "collection", "showItemIfValue": { "equals": "show", "atChildContentPath": "option/identifier" } } ] }, { "type": "subsection", "label": "showItemIfValue", "children": [ { "type": "collection", "children": [ { "type": "row", "children": [ { "type": "textField", "label": "Text", "enabled": false, "mdWidth": 100, "contentPath": "text" } ] } ], "contentPath": "collection", "showItemIfValue": { "atChildContentPath": "option/identifier" } } ] }, { "type": "subsection", "label": "Common Collection", "children": [ { "type": "collection", "children": [ { "type": "row", "children": [ { "type": "textField", "label": "Text", "mdWidth": 50, "contentPath": "text" }, { "type": "singlePickerButton", "label": "Show or Hide", "mdWidth": 25, "options": [ { "title": "Show", "identifier": "show" }, { "title": "Hide", "identifier": "hide" } ], "contentPath": "showHide" }, { "type": "removeButton", "label": "", "title": "Remove Item", "mdWidth": 25 } ] } ], "contentPath": "exampleCommon" }, { "type": "row", "children": [ { "type": "column", "mdWidth": 75 }, { "type": "addButton", "title": "Add Common Item", "mdWidth": 25, "mdPadding": { "top": 0.5, "bottom": 0.5 }, "contentPath": "exampleCommon" } ] } ] } ] } ], "formatSchemaVersion": "1.0" }; var objCopy = null;
Tests:
lodash - cloneDeep
objCopy = _.cloneDeep(obj);
json - parse/stringify
objCopy = JSON.parse(JSON.stringify(obj));
ramda - clone
objCopy = R.clone(obj);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
lodash - cloneDeep
json - parse/stringify
ramda - clone
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):
Based on the provided benchmark data, it appears that: 1. The `json - parse/stringify` test has the highest executions per second (40995.90234375), indicating that JSON parsing and stringification is relatively fast in this browser configuration. 2. The `ramda - clone` test is slightly slower than `json - parse/stringify`, with an execution rate of 37735.7421875. 3. The `lodash - cloneDeep` test is the slowest, with an execution rate of 28356.474609375. Based on these results, it would be safe to conclude that JSON parsing and stringification are generally faster than cloning objects using Lodash or Ramda. However, without more detailed analysis or a larger dataset, it's difficult to draw definitive conclusions about the performance characteristics of each library in this specific browser configuration.
Related benchmarks:
Lodash deep clone vs JSON.stringfy
Lodash cloneDeep vs JSON Clone huge object
Lodash deeper clone vs Spread Clone
cloneDeep vs JSON stringify + parse (long arr)
Lodash cloneDeep vs JSON parse
Comments
Confirm delete:
Do you really want to delete benchmark?