Goran Jurić

"Benchmarking" PHP frameworks

Published on

Although I am not a Drupal user, the chance to visit Drupalcon in Szeged (Hungary) appeared and I couldn’t pass on that one. We got there a little bit late, but just in time to hear Rasmus Lerdorfs keynote speech Simple is Hard. There are some really good ideas for optimizing your applications performance and I strongly recommend it for every PHP developer.

There were also some things I really don’t agree that much. He showed a small PHP frameworks “benchmark” measuring the speed (response time and transactions per second) for each of this frameworks to output the simple HTML page printing out the “Hello world” string. Zend Framework (the framework of my choice) didn’t perform all that bad. Symfony was around 30% slower, and Solar was about 2 times faster. If you are really interested in the numbers have a look at the slides from the session.

The methodology was a little bit questionable. I believe that frameworks offering a caching solution out of the boxes should have been tested with the caching enabled.

Another thing he talked about was removing unnecessary require_once() and include_once() calls from the applications, and their impact on the frameworks speed, and how those calls are handled in PHP internally and how to set up your include path to minimize the impact).

Zend Framework didn’t do that well, as you can see on the graphs plotted out for every framework (dashed lines represent require_once() calls). The main reason for this is I guess that ZF is a loosely coupled framework. The other reason is probably that the ZF is still not mature enough to focus on the optimization issues while there is still so much other work to be done.