string.replace vs regexp.matchAll vs regexp.execFastest: string.replace (2.1x faster)
2,637,067 ops/sec
2,020,862 ops/sec
1,238,920 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| string.replace | |
| regexp.matchAll | |
| regexp.exec |
| Test name | Executions per second |
|---|---|
| ✓ string.replace | 5,812,066 Ops/sec |
| regexp.exec | 4,916,916 Ops/sec |
| regexp.matchAll | 2,778,618 Ops/sec |