includes vs regex vs compiled regex vs variable regexFastest: compiled regex (99.0x faster)
35,832,032 ops/sec
390,528 ops/sec
366,966 ops/sec
361,903 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| includes | |
| regex | |
| compiled regex | |
| variable regex |
| Test name | Executions per second |
|---|---|
| ✓ compiled regex | 37,707,244 Ops/sec |
| includes | 290,214 Ops/sec |
| variable regex | 288,676 Ops/sec |
| regex | 282,872 Ops/sec |