I suggest you ...

About the framework comparison

Hi!

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.

Best regards!

15 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    AnonymousAnonymous shared this idea  ·   ·  Admin →

    11 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • PhalconAdminPhalcon (Lead Developer, Phalcon PHP Framework) commented  · 

        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.

      • carloszcarlosz commented  · 

        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).

      • Sergi de PablosSergi 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.

        Best regards

      • AnonymousAnonymous commented  · 

        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)

        Best regards!

      • PhalconAdminPhalcon (Lead Developer, Phalcon PHP Framework) commented  · 

        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?

      Feedback and Knowledge Base