Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
(Fixed) Array.from length vs Array
(version: 1)
Comparing performance of:
Array.from length vs Array from sparse array
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
/*your preparation JavaScript code goes here To execute async code during the script preparation, wrap it as function globalMeasureThatScriptPrepareFunction, example:*/ async function globalMeasureThatScriptPrepareFunction() { // This function is optional, feel free to remove it. // await someThing(); }
Tests:
Array.from length
Array.from({length: 10000}, (_, i)=>i)
Array from sparse array
Array.from(Array(10000), (_, i)=>i)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Array.from length
Array from sparse array
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
9 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:141.0) Gecko/20100101 Firefox/141.0
Browser/OS:
Firefox 141 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Array.from length
35760.0 Ops/sec
Array from sparse array
18796.0 Ops/sec
Related benchmarks:
reate array by lenght
Assigning new variable
Test array concat
Test array concat with larger array
new Array(length).fill().map vs Array.from({ length }, callback)
Test array ops
how to get last array element
Array.from length vs Array
(Small Array.from length vs Array
Comments
Confirm delete:
Do you really want to delete benchmark?