Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
spread vs array from
(version: 1)
Comparing performance of:
array from vs spread
Created:
5 months ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const arr = Array.from({length: 10000}, (_, i) => i);
Tests:
array from
const uniqueList = Array.from(new Set(arr));
spread
const uniqueList = [...(new Set(arr))];
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:
5 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Browser/OS:
Chrome 142 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
array from
4822.1 Ops/sec
spread
4494.9 Ops/sec
Related benchmarks:
Array.from vs Spread Arrays
array.from vs spread with set
Array.from vs Spread on arrays
spread vs array from with set to arr conversion #3
Array.from vs. Spread
spread vs push 3
Array.from vs Spread (1000 numbers)
Array.from vs Spread [...] from already existing array (to avoid deepCopy)
lodash uniq vs spread new Set() vs Array.from(new Set) medium size
Comments
Confirm delete:
Do you really want to delete benchmark?