Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array.from() vs new Array() without callback
(version: 3)
Comparing performance of:
new Array() vs Array.from()
Created:
one year ago
by:
Registered User
Go to the latest result
Tests:
new Array()
const renderEmptyPricingTableColumns = ({ length }) => { const emptyPeriodArray = new Array(length).fill(null); return emptyPeriodArray.map((_, idx) => ( "empty-period-"+idx ?? 0 )); }; renderEmptyPricingTableColumns({length : 500})
Array.from()
const renderEmptyPricingTableColumns = ({ length }) => { const emptyPeriodArray = Array.from({length}); return emptyPeriodArray.map((_, idx) => ( "empty-period-"+idx ?? 0 )); } renderEmptyPricingTableColumns({length : 500})
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/131.0.0.0 Safari/537.36
Browser/OS:
Chrome 131 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
new Array()
333K/s
Array.from()
71K/s
View exact numbers
Test name
Executions per second
✓
new Array()
332,792 Ops/sec
Array.from()
70,605 Ops/sec
Comments
Confirm delete:
Do you really want to delete benchmark?