5 ms·
This seems to have a copy of the HTTP1.1 ragel parser C from Mongrel https://github.com/fauna/mongrel/tree/master/ext/http11 https://github.com/fauna/mongrel/tr
by davidhollander 16y ago
This seems to have a copy of the HTTP1.1 ragel parser C from Mongrel https://github.com/fauna/mongrel/tree/master/ext/http11 https://github.com/fauna/mongrel/tree/master/ext/http11
Would be interesting to see how its performance compares to Ry's HTTP parser from the Node.js library:
https://github.com/ry/http-parser https://github.com/ry/http-parser
- sambeau 16y agoIt's super-fast.
- davidhollander 16y agoThat's not a comparison and your pronoun's reference is ambiguous.
- Tangurena 16y agoI'm 50 years old, and I get confused by "its" vs "it's" from time to time. So one of my bookmarked pages is: http://garyes.stormloader.com/its.html http://garyes.stormloader.com/its.html
- mdwrigh2 16y agoI don't think he was commenting on his usage of "its" vs. "it's" (which is actually correct), but rather that it's ambiguous which item "it" is referring to -- Ragel or Ry's.
- thurston 16y agoRy's is faster. Ragel does pretty good and it gets you most of the way there when you need something that runs really fast, but it can't beat what a skilled programmer can do to optimize a parser.
- haberman 16y ago> it can't beat what a skilled programmer can do to optimize a parser. What sorts of clever things does Ry's parser do that Ragel can't figure out?
- thurston 16y agoA 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.