RegEx.test vs String.includes vs String.matchFastest: String.includes (6.0x faster)
181,753,712 ops/sec
52,324,312 ops/sec
30,442,656 ops/sec
Fastest: String.includes (81.2x faster)
2,739,950,592 ops/sec
60,426,416 ops/sec
33,724,172 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| RegEx.test | |
| String.includes | |
| String.match |
| Test name | Executions per second |
|---|---|
| ✓ String.includes | 775,188,352 Ops/sec |
| RegEx.test | 390,073,184 Ops/sec |
| String.match | 141,672,944 Ops/sec |