←back to thread

698 points jgrahamc | 1 comments | | HN request time: 0.205s | source
Show context
lkoolma ◴[] No.20424229[source]
Might be late, but has anyone in CloudFlare tried to switch away from regex to something more efficient and powerful? Tools like re2c can convert 100s of regexs and CFG into a single optimized state machine (which includes no back tracking, as far as I remember). It should easily handle 10s of millions transactions per second per core if the complete state machine fits into the CPU level 3 cache (or lower), with a bit of optimization.
replies(2): >>20425025 #>>20426568 #
edwintorok ◴[] No.20425025[source]
There is also Ragel [0], but I think that in this context deploying regexes as strings is safer than generating code and deploying that code (unless Ragel could generate webassembly).

[0]: http://www.colm.net/open-source/ragel/

replies(2): >>20461012 #>>20461038 #
1. thurston ◴[] No.20461038[source]
Sorry I didn't see the parent you were responding too, so my point is actually the same as you already made. Thanks.