|« libevent for PHP||Welcome »|
When software evolves, it often gain features and flexibility, but these also mean bloat. And bloat leads to bad performance.
Sometimes apps get so much bloated and slow that they just become less and less attractive, until the point users can't stand it anymore. I remember using and enjoying the first versions of ACDsee and Azureus years ago, but after they kept adding useless features and bloat, I got rid of both. I'm now happily using Irfanview and uTorrent instead, both very lightweight and fast.
Feature bloat is a trap many coders fall into, and I've tried to avoid it as much as I could when designing nanoserv, keeping it simple and fast ... Then it evolved slowly and steadily during 5 years, gaining a lot of features, and here it is at version 2.0.3, but what about performance ?
Out of curiosity, and also to test the new write buffer optimizations in 2.1-dev, I ran a series of very unscientific performance tests using ab, the Apache benchmark tool (this thing can be really useful), here are the results presented in a nicely colored bar graph :
So the verdict is in line with my previous thoughts: nanoserv 2.0 is about 10% slower than 1.0, not a very good number but still not that bad considering the amount of code more than doubled in the same time.
On the bright side, nanoserv 2.1-dev is faster than any previous version, so here's a proof that even with PHP, code optimizations still give noticeable improvements.
I still have some work to do before 2.1 reaches beta, and there may be even more performance gains when everything is done. In the meantime, if you want to help or just play with it, you can find the current -dev version of nanoserv here : http://nanoserv.si.kz/current/nanoserv.php