array length = 0 vs array = []Fastest: array length = 0 (2.2x faster)
17,673,226 ops/sec
7,879,055 ops/sec
Fastest: array = [] (2.4x faster)
111,264,496 ops/sec
45,674,008 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| array length = 0 | |
| array = [] |
| Test name | Executions per second |
|---|---|
| ✓ array length = 0 | 18,496,626 Ops/sec |
| array = [] | 5,769,134 Ops/sec |