Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Deep cloning of array
(version: 1)
Deep cloning of array in js
Comparing performance of:
json parse vs structuredClone vs lodash
Created:
one year ago
by:
Guest
Go to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
var arr = [1,2,3,4,5,6,7,8,9,10]
Tests:
json parse
JSON.parse(JSON.stringify(arr))
structuredClone
structuredClone(arr)
lodash
_.cloneDeep(arr)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
json parse
structuredClone
lodash
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Browser/OS:
Chrome 134 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
json parse
3.3M/s
lodash
944K/s
structuredClone
543K/s
View exact numbers
Test name
Executions per second
✓
json parse
3,343,066 Ops/sec
lodash
944,216 Ops/sec
structuredClone
543,212 Ops/sec
Related benchmarks
Deep cloning of arrays
Deep cloning of arrays with objects
Lodash cloneDeep vs JSON parse
Clone Array - 07/02/2024
Array From vs lodash clone
Comments
Confirm delete:
Do you really want to delete benchmark?