Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array.from length vs Array
(version: 1)
Comparing performance of:
Array.from length vs Array from sparse array
Created:
one year ago
by:
Guest
Go 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(1000), (_, 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:
11 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/142.0
Browser/OS:
Firefox 142 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Array from sparse array
88K/s
Array.from length
13K/s
View exact numbers
Test name
Executions per second
✓
Array from sparse array
87,938 Ops/sec
Array.from length
13,433 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
(Fixed) Array.from length vs Array
(Small Array.from length vs Array
Comments
Confirm delete:
Do you really want to delete benchmark?