with reduce() vs with sort()Fastest: with reduce() (1.8x faster)
55 ops/sec
30 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| with reduce() | |
| with sort() |
| Test name | Executions per second |
|---|---|
| ✓ with sort() | 157 Ops/sec |
| with reduce() | 104 Ops/sec |