Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
copy typed array with Array.from() vs new Array()
(version: 1)
Testing the difference between creating filled arrays.
Comparing performance of:
new Array() vs Array.from()
Created:
3 days ago
by:
Guest
Jump to the latest result
Tests:
new Array()
const ary = new Uint32Array(1000); const res = new Array(1000); for (let i = 0; i < ary.length; ++i) { res[i] = ary[i]; }
Array.from()
const ary = new Uint32Array(1000); const res = Array.from(ary);
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:
3 days ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36
Browser/OS:
Chrome 149 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
new Array()
254443.5 Ops/sec
Array.from()
37651.6 Ops/sec
Comments
Confirm delete:
Do you really want to delete benchmark?