Regex 1 vs Regex 2 vs Split vs SubstringFastest: Split (86.2x faster)
17,380,608 ops/sec
13,094,294 ops/sec
6,970,800 ops/sec
201,665 ops/sec
Fastest: Substring (2590.6x faster)
639,386,944 ops/sec
7,104,766 ops/sec
6,063,029 ops/sec
246,811 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| Regex 1 | |
| Regex 2 | |
| Split | |
| Substring |
| Test name | Executions per second |
|---|---|
| ✓ Substring | 33,836,904 Ops/sec |
| Split | 26,167,660 Ops/sec |
| Regex 1 | 8,969,296 Ops/sec |
| Regex 2 | 274,761 Ops/sec |