Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Lodash Deep Copy2
(version: 1)
Comparing performance of:
Lodash copydeep vs Spread operator
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here--> <script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js'></script>
Script Preparation code:
var arr = new Array(1000).fill(null).map(() => ({ id: Math.random(), event_id: `evt_${Math.random()}`, calendar_id: `cal_${Math.random()}`, event_json: { title: "Test Event", description: "Test Description", startDate: "2024-01-01", endDate: "2024-01-02", location: { address: "123 Test St", lat: 44.4582983, lng: -93.1616132 }, attendees: [ { email: "test1@test.com", response: "accepted" }, { email: "test2@test.com", response: "pending" } ] }, is_latest: 1, start_date: "2024-01-01", end_date: "2024-01-02" }));
Tests:
Lodash copydeep
myCopy = _.cloneDeep(arr);
Spread operator
myCopy = [...arr];
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Lodash copydeep
Spread operator
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:128.0) Gecko/20100101 Firefox/128.0
Browser/OS:
Firefox 128 on Mac OS X 10.15
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Lodash copydeep
463.6 Ops/sec
Spread operator
265608.8 Ops/sec
Related benchmarks:
Nested vs Cascade
Find events real
Find events real end
[MH-4355][1000]: lodash / es6 filter perf
array iteration vs _.each vs map vs for..of vs for loop AP
array iteration vs _.each vs map vs for..of vs for loop AP1
testing flatMap, filter and for..of loop
Lodash Deep Copy
Lodash Deep Copy3
Comments
Confirm delete:
Do you really want to delete benchmark?