Re:Emiller's Balls-Out Guide to Nginx Module Development
by viraptor on Saturday March 27, 2010 @06:53PM
(#1223842)
I'm not sure if you were just curious, or were you trying to prove that nginx is right in optimising this. But since we have the figures - assuming strcmp takes 37ns, we could estimate that wikipedia spent whole 13 seconds parsing the request verb each day in 2008 (assuming 350M visits). Cutting it down by half would definitely be worth the programming time... not.
[ Parent
| on HN ]
Re:Emiller's Balls-Out Guide to Nginx Module Development
by jws on Saturday March 27, 2010 @10:06PM
(#1224089)
I was mostly just calbrating my opimization decision making.
I think only considering wikipedia visits is underestimating. A visit is many http transactions, and a webserver is targetted for many times the traffic of wikipedia. Still, it is likely no one ever felt a better user exprience from this one optimization.
But what if all the code is 33% faster than strcmp style code? That would be nice, but also seems unlikely.
My biggest two takeaways:
— beware your OS. The freebsd (mac) strcmp is about twice as fast as the GNU glibc.
— forget about gnu's gperf, it is extra complexity for no benefit. Maybe it would win on very long word lists, but I don't know.