Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array.from vs Spread Map Performance
(version: 1)
Comparing performance of Array.from(iterable, mapper) vs [...iterable].map(mapper)
Comparing performance of:
Array.from vs Spread and Map
Created:
2 months ago
by:
Guest
Jump to the latest result
Script Preparation code:
var size = 1000000; var iterable = new Set(Array.from({ length: size }, (_, i) => i)); var mapper = (x) => x * 2;
Tests:
Array.from
var result = Array.from(iterable, mapper);
Spread and Map
var result = [...iterable].map(mapper);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Array.from
Spread and Map
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
2 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36
Browser/OS:
Chrome 145 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Array.from
64.1 Ops/sec
Spread and Map
113.4 Ops/sec
Related benchmarks:
Array.from vs Spread for map values
Array.from vs Spread using Map
Map Array.from vs Spread
Array.from vs Spread with Map
Array.from vs Spread. Map 1000000
Array.from vs Spread of Map
Array.from vs Spread vs For
Array.from vs Spread with mapper func
Array.from vs Spread (Map)
Comments
Confirm delete:
Do you really want to delete benchmark?