On Sun, Feb 19, 2012 at 13:24, lxu4net <[email protected]> wrote: > I'm choosing a HTTP parser for my project. A candidate solution is > writing a custom one in Ragel. I wrote a very simple HTTP parser in > Ragel. > There is a big surprise. the performance of my Ragel parser is twice > faster than nodejs's parser. > I can't sure the result. Is my test has something wrong? > I had posted the sources at https://github.com/lxu4net/RagelHttpParser. > Maybe some guy can check it. > > [ RUN ] ParserPerformance.node > [ OK ] ParserPerformance.node (88266 ms) > [ RUN ] ParserPerformance.ragel > [ OK ] ParserPerformance.ragel (29190 ms)
Your parser is very minimal: it doesn't handle multi-line headers, chunked encoding, trailing headers, CONNECT requests, etc. I suspect that you'll find that the numbers become quite different once you add in everything that you need to be standards compliant (plus some extras to handle non-standard but real world scenarios, of which there are quite a few.) -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
