2 ms·
> 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 f
by SR2Z 2y ago
> 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.