Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
clonedeep vs structuredclone vs jsonstringify parse
(version: 1)
https://developer.mozilla.org/en-US/docs/Web/API/structuredClone
Comparing performance of:
lodash vs structedClone (native) vs JSON.parse
Created:
10 months 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 = { "key1": "value1", "key2": 2, "key3": true, "key4": [1, 2, 3], "key5": { "nested": "object" }, "key6": "value6", "key7": 7, "key8": false, "key9": [9, 8, 7], "key10": { "data": 10 }, "key11": "value11", "key12": 12, "key13": true, "key14": [14], "key15": { "inner": 15 }, "key16": "value16", "key17": 17, "key18": false, "key19": [1, 9], "key20": { "info": "twenty" }, "key21": "value21", "key22": 22, "key23": true, "key24": [24], "key25": { "nested": 25 }, "key26": "value26", "key27": 27, "key28": false, "key29": [2, 9], "key30": { "key": "thirty" }, "key31": "value31", "key32": 32, "key33": true, "key34": [34], "key35": { "number": 35 }, "key36": "value36", "key37": 37, "key38": false, "key39": [3, 9], "key40": { "k": 40 }, "key41": "value41", "key42": 42, "key43": true, "key44": [44], "key45": { "v": 45 }, "key46": "value46", "key47": 47, "key48": false, "key49": [4, 9], "key50": { "x": "fifty" }, "key51": "value51", "key52": 52, "key53": true, "key54": [54], "key55": { "nested": "fifty-five" }, "key56": "value56", "key57": 57, "key58": false, "key59": [5, 9], "key60": { "extra": 60 }, "key61": "value61", "key62": 62, "key63": true, "key64": [64], "key65": { "deep": 65 }, "key66": "value66", "key67": 67, "key68": false, "key69": [6, 9], "key70": { "hint": 70 }, "key71": "value71", "key72": 72, "key73": true, "key74": [74], "key75": { "test": 75 }, "key76": "value76", "key77": 77, "key78": false, "key79": [7, 9], "key80": { "desc": 80 }, "key81": "value81", "key82": 82, "key83": true, "key84": [84], "key85": { "info": "eighty-five" }, "key86": "value86", "key87": 87, "key88": false, "key89": [8, 9], "key90": { "data": 90 }, "key91": "value91", "key92": 92, "key93": true, "key94": [94], "key95": { "final": 95 }, "key96": "value96", "key97": 97, "key98": false, "key99": [9, 9], "key100": { "last": "hundert" } }; var myCopy = null;
Tests:
lodash
myCopy = _.cloneDeep(MyObject);
structedClone (native)
myCopy = structuredClone(MyObject);
JSON.parse
myCopy = JSON.parse(JSON.stringify(MyObject));
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
lodash
structedClone (native)
JSON.parse
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
6 months ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:144.0) Gecko/20100101 Firefox/144.0
Browser/OS:
Firefox 144 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
lodash
43593.9 Ops/sec
structedClone (native)
86904.5 Ops/sec
JSON.parse
103529.3 Ops/sec
Related benchmarks:
Lodash cloneDeep vs structuredClone vs recursiveDeepCopy vs JSON clone more complex object
Lodash cloneDeep vs structuredClone vs recursiveDeepCopy vs JSON clone 10kb json
Lodash cloneDeep vs structuredClone2
Lodash cloneDeep vs structuredClone vs JSON Parse with lots of data
Lodash cloneDeep vs structuredClone 300KB
Lodash cloneDeep vs structuredClone vs JSON-JSON
Lodash cloneDeep vs structuredClone vs JSON Parse (Big Object)
Lodash cloneDeep vs structuredClone 2222
Lodash cloneDeep vs structuredClone 22222
Comments
Confirm delete:
Do you really want to delete benchmark?