2 ms·
> For one thing, it would be slower on non-pathological cases, since backtracking is faster in practice. That's most certainly not universally true. See: https
by burntsushi 8y ago
> For one thing, it would be slower on non-pathological cases, since backtracking is faster in practice.
That's most certainly not universally true. See: https://rust-leipzig.github.io/regex/2017/03/28/comparison-of-regex-engines/ https://rust-leipzig.github.io/regex/2017/03/28/comparison-o...
The real answer is that it's complicated. Backtrackers can certainly be faster in some cases, but not all. Moreover, as someone who has worked on regex engines for a while now, it's not clear to me how exactly to characterize performance differences (outside of pathological cases or cases that otherwise invoke catastrophic backtracking), so my guess is that it's probably mostly up to implementation quality and the optimizations that are implemented.