Tests:
-
new Array(500).fill(0, 0, 500)
-
[...Array(6)].map(x => 0);
Rendered benchmark preparation results:
Latest run results:
Run details: (Test run date:
one year ago)
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
Chrome 131 on Mac OS X 10.15.7
View result in a separate tab
[...Array(6)].map(x => 0);
35.5M/s
new Array(500).fill(0, 0, 500)
2.9M/s
View exact numbers
| Test name |
Executions per second |
|
✓
[...Array(6)].map(x => 0);
|
35,458,124 Ops/sec |
|
new Array(500).fill(0, 0, 500)
|
2,900,678 Ops/sec |
Do you really want to delete benchmark?