About the framework comparison
I checked out the code you used to benchmark frameworks and IMHO the test is not fair with Symfony2. You're using Twig which adds extra overhead both in terms of memory and speed (it is a complete template engine loaded and nothing is used) and for instance Kohana and Zend are just plain files in the view.
Symfony2 should use a return new Symfony\Component\HttpFoundation\Response('<h1>Hello</h1>); in SayController to be analogue and if it is possible, also use ApcUniversalClassLoader in the autoload. Maybe some other fine tunings could be done but these two are the biggest ones.
Of course, I am not saying that Symfony2 should be the fastest, I am just saying that the test is not done in same conditions :). Please note that I am only keen on these 3 frameworks, maybe some other optimizations can be done in CI or Yii to make them faster.
Nikolaos Dimopoulos commented
Please note that Phalcon will no longer using Uservoice for suggestions or feature requests.
You can visit our Github issues page
and post your suggestion there by marking it with the appropriate label and prefixing it with [Feature Request] in the title.
Hi All, the benchmarks were redone using the optimizations provided by the community:
Can you please add http://www.laravel.com/ to the comparinson list?
Hi, benchmarks have been updated using plain php instead of twig on Symfony and using the configuration suggested for Yii.
PS: @mailopl The yii configuration have a parse error. Also, it was necessary to activate importing application.components.* because of the Controller component.
Also, when it comes to the Yii: config.php should look like this: http://codepad.org/kV05ldSF
(no logging, no database no application components)
Just want to point out that Twig templates get compiled to PHP code so it's not as slow as it seems (although it's still an overhead against returning a Respose directly).
The benchmark has been updated with apc.stat = Off. Good news for Yii, now have the third place :)
Hi Guys, We just have uploaded a new github repository https://github.com/phalcon/framework-bench with the benchmark source code. Feel free to push us changes and recomendations. Thanks
Sergi de Pablos commented
"Anonymous" is right. The Symfony 2 settings of you test project are the development ones. I've done some fast tests enabling production settings and disabling some unused extensions and I've more than doubled the performance in my virtual machine, passing from 20 req/s to more than 40, but there's still room for improvement.
And yes, a github public repo to fine tune the tests would be a good idea.
Yes but Symfony2 is kind of Request/Response Framework more than classic MVC like the others are using.
About providing modifications, sure!. Is the benchmark on github so I can make a pull request or how can I send them to you?
Also, another thing to be noted, which will alter Falcon difference vs all non compiled PHP, is that apc.stat should be set to 0 (which is the most similar way to have PHP kind of compiled and not alterable)
Thanks for the feedback!, In all the cases we have been using a view related to the controller instead of an output directly on the controller. Anyway, could you send us the modifications made to the symfony project to remade the benchmark?