Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Lodash CloneDeep vs Imm
(version: 0)
Comparing performance of:
Produce vs CloneDeep
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/immer@3.1.3/dist/immer.umd.min.js"></script> <script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
state = { data: { data1: { data2: { "id": "6679216102cebc200887401f", "name": "New Form", "fields": [ { "id": "e667921669aeeda3469cf2510", "fieldType": "text", "value": "<p style=\"text-align: left;\"><span style=\"font-size: 40px;\"><strong>Phone Verification</strong></span></p>", "styles": { "font-family": "Inter", "margin": "10px 0", "font-weight": 400 }, "subType": "form-heading", "configs": { "data": [] } }, { "id": "e6679217e61efbbf6dda4ba02", "label": { "text": "Phone Number", "alignment": "left" }, "fieldType": "phone", "attributes": { "placeholder": "e.g. 9769235488", "type": "tel", "pattern": "[0-9]{10}", "maxlength": 15, "required": true }, "configs": { "requireVerification": true, "proceedBtnText": "OK", "repeatingCount": 1 }, "mappedId": "t1" }, { "id": "e66792166fc8a7b2e45b324a3", "configs": { "captchaType": "reCaptchaV3" }, "fieldType": "captcha" }, { "id": "e66792166273f92becb49f156", "fieldType": "button", "text": "Submit" } ], "fieldStyles": { "label": { "color": "#4a4a4a", "text-transform": "none", "text-shadow": "0px 0px 0px transparent", "font-size": "14px" }, "input": { "color": "#000", "box-shadow": "0px 0px 0px 0px #000", "font-weight": "400", "font-size": "14px", "border-bottom-color": "#e8e8e8", "border-bottom-width": "1px", "border-bottom-style": "solid", "border-left-color": "#e8e8e8", "border-left-style": "solid", "border-left-width": "1px", "border-right-color": "#e8e8e8", "border-right-style": "solid", "border-right-width": "1px", "border-top-color": "#e8e8e8", "border-top-style": "solid", "border-top-width": "1px" }, "helper": { "font-weight": "normal", "font-size": "10px", "text-transform": "none", "color": "#fff" }, "helper2": { "color": "#000" } }, "folderId": null, "styles": { "border-top-color": "#d9dfe8", "border-right-color": "#d9dfe8", "border-bottom-color": "#d9dfe8", "border-left-color": "#d9dfe8", "border-top-style": "solid", "border-right-style": "solid", "border-bottom-style": "solid", "border-left-style": "solid", "border-top-width": "1px", "border-right-width": "1px", "border-bottom-width": "1px", "border-left-width": "1px", "box-shadow": "0px 0px 0px 0px #000" }, "configs": { "defaultLanguage": "en", "requireVerification": true, "activeTemplate": { "id": "form-design-27", "name": "form-design-27", "preview": "https://assets.frms.link/templates/Form27.png", "configs": null }, "template": { "name": "form-design-27", "configs": {} }, "enableWelcome": false, "enableThankyou": true, "inBrowserDataStorage": false, "thankyouIndex": 0, "verifyFirst": false, "mappedIdCount": { "t": 1, "n": 0, "d": 0, "m": 0 } }, "integrations": [], "thankyou": [ { "id": "e6679216452b1c162a67c016a", "fieldType": "image", "attributes": { "src": "https://assets.frms.link/editor-assets/icons/tick-filled.svg" }, "styles": { "width": "10%" } }, { "id": "e66792164f26f431d234a61b4", "fieldType": "text", "value": "<p style=\"text-align: center;\">Your submission has been successfully recorded</p>", "styles": { "font-family": "Inter", "margin": "10px 0", "font-size": "20px", "line-height": "20px" } } ], "welcome": [ { "id": "e667921645f194b63eae7542e", "fieldType": "text", "value": "<p style=\"text-align: center;\"><span style=\"font-size: 20pt;\">Welcome</span></p>", "styles": { "font-family": "Inter", "margin": "10px 0", "font-size": "20px", "line-height": "20px" } } ], "adminFields": [], "favouriteFields": [], "createdFrom": "scratch" } } } };
Tests:
Produce
const result = immer.produce(state, draft => { draft.data.data1.data2 = {test:'updated'} })
CloneDeep
const result = _.cloneDeep(state); result.data.data1.data2 = {test:'updated'};
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Produce
CloneDeep
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Browser/OS:
Chrome 126 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Produce
289824.6 Ops/sec
CloneDeep
39840.9 Ops/sec
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
I'll answer the question based on the provided JSON data. The data appears to be a benchmarking result with two test cases: "Produce" and "CloneDeep". For the "Produce" test case, the benchmark result is: * Browser: Chrome 126 * DevicePlatform: Desktop * OperatingSystem: Mac OS X 10.15.7 * ExecutionsPerSecond: 289824.59375 This suggests that the "Produce" test case ran in approximately 288 seconds (or around 4.8 minutes) and executed at a rate of about 290,000 times per second. For the "CloneDeep" test case, the benchmark result is: * Browser: Chrome 126 * DevicePlatform: Desktop * OperatingSystem: Mac OS X 10.15.7 * ExecutionsPerSecond: 39840.9375 This suggests that the "CloneDeep" test case ran in approximately 40 seconds and executed at a rate of about 39,840 times per second. The "Html Preparation Code" section appears to be unrelated to the benchmarking results, as it contains HTML code snippets for a JavaScript library (Immer) and another utility function (Lodash). The individual test cases are also provided, which describe two separate testing scenarios: 1. Produce: A test case that uses the `immer.produce` function to update the state. 2. CloneDeep: A test case that uses the `_` object to clone a deep copy of the state. These test cases seem to be related to benchmarking the performance of these JavaScript libraries, but their specific details and context are not provided in the given data.
Related benchmarks:
Lodash cloneDeep vs clone vs spread
Lodash deep clone vs Spread Clone
Lodash deeper clone vs Spread Clone
Lodash cloneDeep vs JSON Clone with Array
Lodash cloneDeep VS mutate
Comments
Confirm delete:
Do you really want to delete benchmark?