4 ms·
A sure-fire way to beat a Ragel parser is to look ahead several characters and test the limited possibilities that are present when a language has literal strin
by thurston 16y ago
A sure-fire way to beat a Ragel parser is to look ahead several characters and test the limited possibilities that are present when a language has literal strings like GET and POST. You can essentially fall back to extremely fast string searching algorithms in certain places.
Ragel assumes character-by-character parsing and it's difficult to generate fast code that looks ahead without running into buffer block boundaries. It could be done though.
You can also use character classes to reduce the number of tests. Ragel doesn't try to figure those out.