<div dir="ltr"><div>Thanks for the reply.<br><br></div>I have another question, was any state machine generators like ragel used to code this or this is completely hand written?<br><br><br><div class="gmail_extra">Anshuk<br>
</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 24, 2013 at 4:21 PM, Maxim Dounin <span dir="ltr"><<a href="mailto:mdounin@mdounin.ru" target="_blank">mdounin@mdounin.ru</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello!<br>
<div class="im"><br>
On Sun, Jun 23, 2013 at 11:16:21AM +0530, anshuk kumar wrote:<br>
<br>
> This is in reference to the following code<br>
><br>
> <a href="https://github.com/joyent/http-parser" target="_blank">https://github.com/joyent/http-parser</a><br>
><br>
> What could be the main reason for such a design decision? I guess I could<br>
> write few regular expressions to parse HTTP req & res this would be a lot<br>
> less complex than Igor's version of the parser.<br>
><br>
> What am I missing here?<br>
<br>
</div>Regular expressions isn't something readily available when you<br>
code in C, nor something which can be easily used to parse data<br>
available in chunks. It's also highly unlikely that even<br>
carefully coded regular expressions will be able to beat C code in<br>
terms of performance.<br>
<br>
Of course if you are coding some simple http server in perl or<br>
javascript - using regular expressions is a way to go. But it's<br>
unlikely a good choise if you are coding high performance web<br>
server in C.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Maxim Dounin<br>
<a href="http://nginx.org/en/donation.html" target="_blank">http://nginx.org/en/donation.html</a><br>
<br>
_______________________________________________<br>
nginx-devel mailing list<br>
<a href="mailto:nginx-devel@nginx.org">nginx-devel@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a><br>
</font></span></blockquote></div><br></div></div>