includes vs lookup vs indexofFastest: lookup (1.6x faster)
28,113,452 ops/sec
27,094,768 ops/sec
17,640,060 ops/sec
Fastest: lookup (57.6x faster)
1,503,163,008 ops/sec
31,744,506 ops/sec
26,090,802 ops/sec
Fastest: lookup (1.5x faster)
15,421,944 ops/sec
13,380,165 ops/sec
10,504,388 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| includes | |
| lookup | |
| indexof |
| Test name | Executions per second |
|---|---|
| ✓ lookup | 234,649,360 Ops/sec |
| indexof | 58,273,688 Ops/sec |
| includes | 54,454,748 Ops/sec |