Re:Matching Regexps 200 Times Faster
by SR2Z on Wednesday March 19, 2025 @01:30PM
(#43414925)
> Cool, but what about replacing the regexp with straightforward parsing code written manually?
It would not be faster - an FSM can trivially be created as a few jump tables which fit in cache. This is one of the rare cases where a compiler can be provably optimal.
Hell, a regex compiler could even transform the FSM to read a 4-character sequence at a time for SIMD if it made sense.
It would not be faster - an FSM can trivially be created as a few jump tables which fit in cache. This is one of the rare cases where a compiler can be provably optimal.
Hell, a regex compiler could even transform the FSM to read a 4-character sequence at a time for SIMD if it made sense.