Hacker News new | ask | show | jobs
by burntsushi 540 days ago
Not easily. But not all use cases require it. The regex crate makes heavy use of this pattern for finite machine states, for example. But this fits nicely with an arena allocation pattern, so everything can just be dropped at once.

Despite this, it's one of the fastest regex engines around: https://github.com/BurntSushi/rebar#summary-of-search-time-b...

Here's a related but more isolated analysis: https://github.com/burntsushi/rsc-regexp

1 comments

You could probably make an even faster regex by JIT-compiling the resulting automaton.
The benchmarks I linked include multiple regex engines with JITs.