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
Jump 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
Test name
Executions per second
json parse
3343066.0 Ops/sec
structuredClone
543211.9 Ops/sec
lodash
944216.0 Ops/sec
Related benchmarks:
Array clone
Clone vs JSON.stringify+JSON.parse
Clone deep
cloneDeep vs JSON stringify + parse (long arr)
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?