27 ms·
Probably because is much slower than nginx, C++ adds extra "fat" that nginx (writen in C) doesn't have.
by givan 15y ago
Probably because is much slower than nginx, C++ adds extra "fat" that nginx (writen in C) doesn't have.
- apaprocki 15y agoNot sure that matters much.. the code style is very C/C++. (e.g. using stdio instead of iostreams, malloc/free instead of new/delete, no STL)
- swah 15y agoIf its faster than nginx, Igor just removes some sleep() calls.
- sigil 15y agoNot sure about C++ overhead there. C++ often edges out C in the alioth benchmarks. More to the point, I highly doubt the author's parser ("parser") in http.cpp is faster than the one in nginx, which really is a thing of beauty. http://trac.nginx.org/nginx/browser/nginx/trunk/src/http/ngx_http_parse.c http://trac.nginx.org/nginx/browser/nginx/trunk/src/http/ngx...
- swah 15y agoThis is so verbose, it must have been rewritten for performance so many times :)
- kingkilr 15y agoI really love the trick for efficiently reading 4 chars and checking them out of a string. I like it so much I've been working towards making it happen automatically on PyPy so if you write something like: if buf[i:i+4] == "POST": the JIT automatically turns that into a MOVL + CMP + JMP. The magic of high level languages :)