Tests:
-
reduce + Array.prototype.concat
-
Array.prototype.flatMap
Results show median performance across all community submissions.
Run this benchmark yourself to verify on your device.
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/136.0.0.0 Safari/537.36
Chrome 136 on Mac OS X 10.15.7
View result in a separate tab
Array.prototype.flatMap
1.7M/s
reduce + Array.prototype.concat
1.2M/s
View exact numbers
| Test name |
Executions per second |
|
✓
Array.prototype.flatMap
|
1,685,277 Ops/sec |
|
reduce + Array.prototype.concat
|
1,165,715 Ops/sec |
Do you really want to delete benchmark?