Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
new Array(length) vs Array.from({ length })
(version: 1)
Comparing performance of:
new Array vs Array.from
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const ARRAY_LENGTH = 10000;
Tests:
new Array
new Array(ARRAY_LENGTH)
Array.from
Array.from({ length: ARRAY_LENGTH })
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
new Array
Array.from
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/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Browser/OS:
Chrome 133 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
new Array
166397312.0 Ops/sec
Array.from
4529.0 Ops/sec
Related benchmarks:
Array.from() vs new Array()
Array.from vs new Array
Creation of new Array: Array.from vs. new Array
my Array.from() vs new Array()
Array.from() vs []
Array.from() vs new Array() - empty
Array.from({ length: n }) vs new Array(n)
Array.from() vs new A
Array(length).fill() vs Array.from({ length: length })
Array.from() vs new Array() vs []
Comments
Confirm delete:
Do you really want to delete benchmark?