Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Lodash cloneDeep vs JSON Clone - cnm-tes-1234234324
(version: 0)
Comparing performance of:
Lodash cloneDeep vs Json clone
Created:
5 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 MyObject ={ "_id": "5f99883a8fe8d529d1c5a177", "index": 0, "guid": "8df30cb2-d3ec-41f4-907e-7b1572ea2134", "isActive": false, "balance": "$2,932.44", "picture": "http://placehold.it/32x32", "age": 27, "eyeColor": "green", "name": "Rosalind Pittman", "gender": "female", "company": "CUIZINE", "email": "rosalindpittman@cuizine.com", "phone": "+1 (968) 570-2863", "address": "733 Junius Street, Heil, Kentucky, 9244", "about": "Ut veniam tempor consectetur dolor nostrud sit consequat enim cupidatat laboris labore elit. Cillum nisi velit ad cupidatat. Reprehenderit voluptate nisi pariatur pariatur irure voluptate do ad consequat duis in commodo cupidatat pariatur.\r\n", "registered": "2019-10-17T03:14:27 -06:-30", "latitude": -51.905699, "longitude": -173.59725, "tags": [ "mollit", "ad", "labore", "cupidatat", "in", "qui", "reprehenderit", "in", "duis", "minim", "et", "laborum", "nostrud", "officia", "nisi" ], "friends": [ { "id": 0, "name": "Fowler Spencer", "email": "fowlerspencer@cuizine.com", "phone": "+1 (995) 405-2382" }, { "id": 1, "name": "Macdonald Davenport", "email": "macdonalddavenport@cuizine.com", "phone": "+1 (844) 563-3160" }, { "id": 2, "name": "Guthrie Oneal", "email": "guthrieoneal@cuizine.com", "phone": "+1 (804) 553-3077" }, { "id": 3, "name": "Rachael Whitney", "email": "rachaelwhitney@cuizine.com", "phone": "+1 (963) 402-3577" }, { "id": 4, "name": "Lindsey Cleveland", "email": "lindseycleveland@cuizine.com", "phone": "+1 (911) 511-2808" }, { "id": 5, "name": "Hewitt Hoffman", "email": "hewitthoffman@cuizine.com", "phone": "+1 (987) 479-2785" }, { "id": 6, "name": "Louella Blake", "email": "louellablake@cuizine.com", "phone": "+1 (866) 561-3171" }, { "id": 7, "name": "Katina Erickson", "email": "katinaerickson@cuizine.com", "phone": "+1 (914) 515-3752" }, { "id": 8, "name": "Roberts Rivas", "email": "robertsrivas@cuizine.com", "phone": "+1 (811) 479-2009" }, { "id": 9, "name": "Geneva Moore", "email": "genevamoore@cuizine.com", "phone": "+1 (968) 463-3174" }, { "id": 10, "name": "Horne Michael", "email": "hornemichael@cuizine.com", "phone": "+1 (983) 545-3129" }, { "id": 11, "name": "Angeline Grimes", "email": "angelinegrimes@cuizine.com", "phone": "+1 (946) 551-2105" }, { "id": 12, "name": "Payne Castro", "email": "paynecastro@cuizine.com", "phone": "+1 (813) 563-3222" }, { "id": 13, "name": "Shawn Irwin", "email": "shawnirwin@cuizine.com", "phone": "+1 (977) 510-3956" }, { "id": 14, "name": "Rowe Lyons", "email": "rowelyons@cuizine.com", "phone": "+1 (849) 549-3977" }, { "id": 15, "name": "Fry Sherman", "email": "frysherman@cuizine.com", "phone": "+1 (962) 599-3079" }, { "id": 16, "name": "Winifred Stevenson", "email": "winifredstevenson@cuizine.com", "phone": "+1 (864) 444-3603" }, { "id": 17, "name": "Haynes Bolton", "email": "haynesbolton@cuizine.com", "phone": "+1 (998) 534-3926" }, { "id": 18, "name": "Margaret Duncan", "email": "margaretduncan@cuizine.com", "phone": "+1 (964) 440-2569" }, { "id": 19, "name": "Tiffany Gonzalez", "email": "tiffanygonzalez@cuizine.com", "phone": "+1 (812) 494-2174" }, { "id": 20, "name": "Letitia Mercer", "email": "letitiamercer@cuizine.com", "phone": "+1 (930) 456-2426" }, { "id": 21, "name": "Alice Brady", "email": "alicebrady@cuizine.com", "phone": "+1 (806) 529-2154" }, { "id": 22, "name": "Lupe Hampton", "email": "lupehampton@cuizine.com", "phone": "+1 (860) 513-2249" }, { "id": 23, "name": "Angelique Dale", "email": "angeliquedale@cuizine.com", "phone": "+1 (833) 538-2043" }, { "id": 24, "name": "Harrington Boone", "email": "harringtonboone@cuizine.com", "phone": "+1 (944) 463-2112" }, { "id": 25, "name": "Trudy Dawson", "email": "trudydawson@cuizine.com", "phone": "+1 (808) 415-2729" }, { "id": 26, "name": "Mccoy Collier", "email": "mccoycollier@cuizine.com", "phone": "+1 (949) 584-2143" }, { "id": 27, "name": "Stefanie Bridges", "email": "stefaniebridges@cuizine.com", "phone": "+1 (858) 535-3206" }, { "id": 28, "name": "Villarreal Pennington", "email": "villarrealpennington@cuizine.com", "phone": "+1 (834) 435-3204" }, { "id": 29, "name": "Casey Pacheco", "email": "caseypacheco@cuizine.com", "phone": "+1 (875) 519-2531" } ], "greeting": "Hello, Rosalind Pittman! You have 4 unread messages.", "favoriteFruit": "strawberry" } var myCopy = null;
Tests:
Lodash cloneDeep
myCopy = _.cloneDeep(MyObject);
Json clone
myCopy = JSON.parse(JSON.stringify(MyObject));
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 do my best to provide an answer. It appears that we have a JSON object `MyObject` which contains an array of 10 objects representing contact information, along with some additional metadata such as a greeting and a favorite fruit. We also have two benchmark test cases: one using Lodash's `cloneDeep` function and the other using `JSON.parse(JSON.stringify(MyObject))`. We are comparing the performance of these two methods in cloning the `MyObject` array. The latest benchmark result shows that: * The "Json clone" test case (using `JSON.parse(JSON.stringify(MyObject))`) has a higher executions per second value (23565.982421875) compared to the "Lodash cloneDeep" test case (24934.2890625). * However, the Lodash method is still faster than the JSON method. To provide more context or clarify any assumptions I've made, could you please provide more information about the requirements and constraints of this problem?
Related benchmarks:
Lodash cloneDeep vs JSON Clone (Large Object 2)
Lodash cloneDeep vs JSON Clonea
Lodash cloneDeep vs JSON Clone large Json
Lodash cloneDeep vs JSON Clone Large object
Lodash(v4.17.21) cloneDeep vs JSON Clone Larger object
Comments
Confirm delete:
Do you really want to delete benchmark?