Regex vs .indexOfFastest: .indexOf (24.8x faster)
12,199 ops/sec
491 ops/sec
Fastest: .indexOf (22.1x faster)
17,404 ops/sec
787 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| Regex | |
| .indexOf |
| Test name | Executions per second |
|---|---|
| ✓ .indexOf | 12,053 Ops/sec |
| Regex | 1,364 Ops/sec |