Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Test123421424124
(version: 0)
Comparing performance of:
Lodash cloneDeep vs Json clone
Created:
6 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 MyObject1 = { "name": "Test deployable unit", "description": "Only for test", "information_class": "TestClass", "developer_email": "developers@homedepot.com", "support_email": "support@homedepot.com", "tags": "test1, test2, test3", "profiles": [ { "name": "FRONT_OF_STORE", "path": "", "environments": [ { "name": "DEV", "path": "", "properties": [ { "key": "secret.value", "value": "_SECRET_", "promotable": false, "secure": true }, { "key": "public.value", "value": "SomeValue", "promotable": false, "secure": false }, { "key": "promotable.value", "value": "TestValue", "promotable": true, "secure": false } ], "contexts": [] }, { "name": "STAGE", "path": "", "properties": [ { "key": "secret.value_stage", "value": "_SECRET_", "promotable": false, "secure": true }, { "key": "public.value_stage", "value": "SomeValue", "promotable": false, "secure": false } ], "contexts": [] } ], "properties": [ { "key": "secret.value_front_of_store", "value": "_SECRET_", "promotable": false, "secure": true }, { "key": "public.value_front_of_store", "value": "SomeValue", "promotable": false, "secure": false }, { "key": "promotable.value_front_of_store", "value": "TestValue", "promotable": true, "secure": false } ] }, { "name": "DATA_CENTER", "path": "", "environments": [ { "name": "QA", "path": "", "properties": [ { "key": "secret.value_dc_qa", "value": "_SECRET_", "promotable": false, "secure": true }, { "key": "public.value_dc_qa", "value": "SomeValue", "promotable": false, "secure": false }, { "key": "promotable.value_dc_qa", "value": "TestValue", "promotable": true, "secure": false } ], "contexts": [] }, { "name": "PROD", "path": "", "properties": [ { "key": "secret.value_dc_prod", "value": "_SECRET_", "promotable": false, "secure": true }, { "key": "public.value_dc_prod", "value": "SomeValue", "promotable": false, "secure": false }, { "key": "promotable.value_dc_prod", "value": "TestValue", "promotable": true, "secure": false } ], "contexts": [] } ], "properties": [ { "key": "secret.value_dc", "value": "_SECRET_", "promotable": false, "secure": true }, { "key": "public.value_dc", "value": "SomeValue", "promotable": false, "secure": false }, { "key": "promotable.value_dc", "value": "TestValue", "promotable": true, "secure": false } ] }, { "name": "DOCKER", "path": "", "environments": [ { "name": "DEV", "path": "", "properties": [ { "key": "secret.value_dc_prod", "value": "_SECRET_", "promotable": false, "secure": true }, { "key": "public.value_dc_prod", "value": "SomeValue", "promotable": false, "secure": false }, { "key": "promotable.value_dc_prod", "value": "TestValue", "promotable": true, "secure": false } ], "contexts": [] }, { "name": "PROD", "path": "", "properties": [], "contexts": [] }, { "name": "CUSTOM DEV", "path": "", "properties": [], "contexts": [] } ], "properties": [] } ], "defaults": [] }; var MyObject2 = { "name": "Test deployable unit", "description": "Only for test", "information_class": "TestClass", "developer_email": "developers@homedepot.com", "support_email": "support@homedepot.com", "tags": "test1, test2, test3", "profiles": [ { "name": "FRONT_OF_STORE", "path": "", "environments": [ { "name": "DEV", "path": "", "properties": [ { "key": "secret.value", "value": "_SECRET_", "promotable": false, "secure": true }, { "key": "public.value", "value": "SomeValue", "promotable": false, "secure": false }, { "key": "promotable.value", "value": "TestValue", "promotable": true, "secure": false } ], "contexts": [] }, { "name": "STAGE", "path": "", "properties": [ { "key": "secret.value_stage", "value": "_SECRET_", "promotable": false, "secure": true }, { "key": "public.value_stage", "value": "SomeValue", "promotable": false, "secure": false } ], "contexts": [] } ], "properties": [ { "key": "secret.value_front_of_store", "value": "_SECRET_", "promotable": false, "secure": true }, { "key": "public.value_front_of_store", "value": "SomeValue", "promotable": false, "secure": false }, { "key": "promotable.value_front_of_store", "value": "TestValue", "promotable": true, "secure": false } ] }, { "name": "DATA_CENTER", "path": "", "environments": [ { "name": "QA", "path": "", "properties": [ { "key": "secret.value_dc_qa", "value": "_SECRET_", "promotable": false, "secure": true }, { "key": "public.value_dc_qa", "value": "SomeValue", "promotable": false, "secure": false }, { "key": "promotable.value_dc_qa", "value": "TestValue", "promotable": true, "secure": false } ], "contexts": [] }, { "name": "PROD", "path": "", "properties": [ { "key": "secret.value_dc_prod", "value": "_SECRET_", "promotable": false, "secure": true }, { "key": "public.value_dc_prod", "value": "SomeValue", "promotable": false, "secure": false }, { "key": "promotable.value_dc_prod", "value": "TestValue", "promotable": true, "secure": true } ], "contexts": [] } ], "properties": [ { "key": "secret.value_dc", "value": "_SECRET_", "promotable": false, "secure": true }, { "key": "public.value_dc", "value": "SomeValue", "promotable": false, "secure": false }, { "key": "promotable.value_dc", "value": "TestValue", "promotable": true, "secure": false } ] }, { "name": "DOCKER", "path": "", "environments": [ { "name": "DEV", "path": "", "properties": [ { "key": "secret.value_dc_prod", "value": "_SECRET_", "promotable": false, "secure": true }, { "key": "public.value_dc_prod", "value": "SomeValue", "promotable": false, "secure": false }, { "key": "promotable.value_dc_prod", "value": "TestValue", "promotable": true, "secure": false } ], "contexts": [] }, { "name": "PROD", "path": "", "properties": [], "contexts": [] }, { "name": "CUSTOM DEV", "path": "", "properties": [], "contexts": [] } ], "properties": [] } ], "defaults": [] };
Tests:
Lodash cloneDeep
console.log(_.isEqual(MyObject1, MyObject2));
Json clone
console.log(JSON.stringify(MyObject1) === JSON.stringify(MyObject2));
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Lodash cloneDeep
Json 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):
I'll provide the code snippet that corresponds to the provided JSON data. ```javascript const MyObject1 = { environments: [ { name: 'DEV', path: '', properties: [ { key: 'secret.value_dc_prod', value: '_SECRET_', promotable: false, secure: true }, { key: 'public.value_dc_prod', value: 'SomeValue', promotable: false, secure: false }, { key: 'promotable.value_dc_prod', value: 'TestValue', promotable: true, secure: false } ], contexts: [] }, { name: 'PROD', path: '', properties: [], contexts: [] }, { name: 'CUSTOM DEV', path: '', properties: [], contexts: [] } ], properties: [ { key: 'secret.value_dc', value: '_SECRET_', promotable: false, secure: true }, { key: 'public.value_dc', value: 'SomeValue', promotable: false, secure: false }, { key: 'promotable.value_dc', value: 'TestValue', promotable: true, secure: false } ] }; const MyObject2 = JSON.parse(JSON.stringify(MyObject1)); ``` And here's the prepared HTML code: ```html <!DOCTYPE html> <html> <head> <title>My Page</title> </head> <body> <!-- Your content here --> </body> </html> ``` Note: I didn't include any specific Lodash or console.log functionality in the provided code snippet, as it seems to be part of a larger benchmarking test. The `JSON.stringify` method is used to clone the JSON data from `MyObject1` to `MyObject2`.
Related benchmarks:
hasOwnProperty vs index/undefined
key exists: key in object vs !!object[key] vs object[key]
prop set
Different ways of creating objects
Different ways of creating objects 2
Comments
Confirm delete:
Do you really want to delete benchmark?