Array includes vs Set has vs Map has27,833,334 ops/sec
27,016,640 ops/sec
25,818,656 ops/sec
Fastest: Set has (33.3x faster)
1,772,593,408 ops/sec
1,645,939,712 ops/sec
53,206,844 ops/sec
Fastest: Map has (1.4x faster)
23,277,172 ops/sec
22,446,424 ops/sec
16,242,416 ops/sec
Fastest: Map has (7.3x faster)
515,626,432 ops/sec
509,659,776 ops/sec
70,528,304 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| Array includes | |
| Set has | |
| Map has |
| Test name | Executions per second |
|---|---|
| ✓ Set has | 193,776,864 Ops/sec |
| Map has | 190,644,896 Ops/sec |
| Array includes | 91,008,784 Ops/sec |