Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Test script
(version: 0)
테스트
Comparing performance of:
makeArray with Length vs Push Array vs Make Array use Array from
Created:
2 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var arrayLength = 1000;
Tests:
makeArray with Length
var arr = Array(arrayLength) arr.forEach((v,i) => { arr[i] = i; })
Push Array
var arr = [] for (let i = 0; i < arrayLength; i++) { arr[i] = i; }
Make Array use Array from
var arr = Array.from(arrayLength, () => {return null}) arr.forEach((v,i) => { arr[i] = i; })
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
makeArray with Length
Push Array
Make Array use Array from
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
2 years ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Browser/OS:
Chrome 121 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
makeArray with Length
651843.7 Ops/sec
Push Array
32893.9 Ops/sec
Make Array use Array from
5420620.0 Ops/sec
Related benchmarks:
array test
withLength
length or no length
array.length vs array.length > 0 without console.log
array.length vs array.length > 0 2
Comments
Confirm delete:
Do you really want to delete benchmark?