Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Set(1,000,000 length) Convert | Array.from vs Spread
(version: 2)
Comparing performance of:
Array.from vs Spread
Created:
one year ago
by:
Registered User
Go to the latest result
Script Preparation code:
const largeSet = new Set(); for (let i = 0; i < 1_000_000; i++) { largeSet.add(i); }
Tests:
Array.from
const arrFromSet = Array.from(largeSet);
Spread
const arrSpreadSet = [...largeSet];
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Array.from
Spread
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_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.1 Safari/605.1.15
Browser/OS:
Safari 18 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Array.from
144/s
Spread
139/s
View exact numbers
Test name
Executions per second
✓
Array.from
144 Ops/sec
Spread
139 Ops/sec
Related benchmarks
Array.from vs Spreadv2
JS Array.from vs Spread [...]
Array.from vs Spread using 1000000 elements / only counts conversion
Array.from vs Spread using 10000 elements / only counts conversion
Array(1,000,000 length) Convert | Array.from vs Spread
Array(1,000,000 length) Mapping | Array.from vs Spread
Comments
Confirm delete:
Do you really want to delete benchmark?