logoalt Hacker News

feldrimtoday at 1:30 PM1 replyview on HN

Would SearchValues<char> help there for a fallback to a SIMD optimized simple string literal search rather than the happy path?


Replies

ievievtoday at 1:42 PM

Yes, that's exactly what we did to be competitive in the benchmarks.

There's a lot of simple cases where you don't really need a regex engine at all.

integrating SearchValues as a multi-string prefix search is a bit harder since it doesn't expose which branch matched so we would be taking unnecessary steps.

Also .NET implementation of Hyperscan's Teddy algorithm only goes left to right.. if it went right to left it would make RE# much faster for these cases.