Controversial opinion time: The advantages of Thompson NFA regexes are just theoretical and not worth it. PCRE is faster in the real world.
Note that for JS regex implementations this is the wrong tradeoff if you could compile faster in common cases with recursive backtracking.
-
-
SunSpider regex test: https://github.com/WebKit/webkit/blob/master/PerformanceTests/SunSpider/tests/sunspider-1.0.2/regexp-dna.js#L1684 … Runs repeatedly for a few ms at most. Compilation speed dominates…
-
Note that compilation time *plus* runtime is your SunSpider score. So compilation time counts against you…
- 1 more reply
New conversation -
-
-
It's mildly fascinating to imagine how fast a regex implementation could compile. I think your attitude to RE2-like things (and, by extension, Hyperscan, which is even more extreme) in this context re average speed including compilation is not *wrong* but it isn't a necessary ...
-
consequence of Thompson/Glushkov/McNaughton-Yamada type constructions vs backtracking - it's just that the whole world of RE2 etc. are built with the assumption that 'study time is cheaper than run-time' (Hyperscan would have an extreme weighting here).
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.