Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
spread before shallow copy array method
(version: 1)
Comparing performance of:
with spread vs without spread
Created:
one year ago
by:
Registered User
Jump to the latest result
Script Preparation code:
const array = Array.from({ length: 1_000_000 }, (_, i) => i);
Tests:
with spread
;[...array].filter((i) => i % 2);
without spread
;array.filter((i) => i % 2);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
with spread
without spread
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Browser/OS:
Chrome 133 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
with spread
28.8 Ops/sec
without spread
107.2 Ops/sec
Related benchmarks:
Array.apply vs Spread new array
Array.from vs Spread with undefined and map
Cloning array: Array.from vs spread
Cloning array: Array.from vs spread (correction)
Array.from vs Spread Arrays
Cloning array: Array.from vs spread corrected
Array.from() vs spread []
Slice vs spread array
spread vs ArrayFrom
Comments
Confirm delete:
Do you really want to delete benchmark?