Preallocate vs Preallocate & fill vs Push vs IndexFastest: Preallocate (2.7x faster)
99,494 ops/sec
55,079 ops/sec
45,285 ops/sec
37,245 ops/sec
Fastest: Preallocate (1.5x faster)
21,923 ops/sec
20,104 ops/sec
18,922 ops/sec
14,614 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| Preallocate | |
| Preallocate & fill | |
| Push | |
| Index |
| Test name | Executions per second |
|---|---|
| ✓ Preallocate | 18,162 Ops/sec |
| Push | 17,277 Ops/sec |
| Index | 15,068 Ops/sec |
| Preallocate & fill | 11,908 Ops/sec |