new Array() vs Array.from() vs push vs Hardcoded ArrayFastest: Hardcoded Array (2441.2x faster)
168,265,952 ops/sec
2,013,938 ops/sec
981,027 ops/sec
68,928 ops/sec
Fastest: Hardcoded Array (2.8x faster)
924,394 ops/sec
730,252 ops/sec
724,339 ops/sec
327,090 ops/sec
Fastest: Hardcoded Array (1093.8x faster)
424,699,008 ops/sec
953,180 ops/sec
641,810 ops/sec
388,290 ops/sec
Fastest: Hardcoded Array (2365.1x faster)
84,908,800 ops/sec
533,185 ops/sec
342,962 ops/sec
35,900 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| new Array() | |
| Array.from() | |
| push | |
| Hardcoded Array |
| Test name | Executions per second |
|---|---|
| ✓ Hardcoded Array | 162,442,400 Ops/sec |
| push | 1,300,973 Ops/sec |
| new Array() | 1,219,638 Ops/sec |
| Array.from() | 62,310 Ops/sec |