symfony 2.0 performance tests

I went through performance tests on the symfony 2.0 official website.

According to them symfony 2.0 is 75% faster than yii 1.1.1

First, is Yii 1.1.1 out… ?

Second, how is that even possible ?

here is the link to those tests :

Sounds like a revenge to me.

I’ve read the Symfony 2 page some days ago and I think it’s pretty impressive. Ah nice thing is that they use namespaces for example. Also the coding standards applied in the source is exactly how I write code - I was happily surprised. :lol: Though, it’s a long way to go since first release is set for end of 2010.

Note that it says “50% faster than Yii 1.1.1 - for production mode” (that’s what counts). They tested the trunk version, where it says in the changelog “1.1.1 - to be released”. Other than that I wonder why you guys always freak out when you see frameworks claiming to be faster than Yii? In this case I guess Smyfony just has a slim core with less “magic” involved. Also possible that they gain some speed from the usage of php namespaces, don’t know.

Yii 1.1.1 is not out yet. I guess they used the trunk code.

The comparison is a bit unfair for yii in two aspects:

  1. the data caching is not enabled for yii, which results in parsing the URL rules for every request. Symfony, on the hand, caches their url rules by default. And solar doesn’t support two-way URL management.

  2. nested layout is used for yii (column1->main) in their second comparison, while other frameworks only use one-level layout.

My guess is that with the above two aspects fixed, the gap won’t be as big as shown in their results.

I am not sure if the benchmark makes a lot of sense because it seems to me it focuses too much on the routing part (10 URL rules are used). A typical yii application should use less than 5 rules if most of its URLs are regular.

At this moment, improving the performance is not the top priority for yii because we haven’t heard any user complaining about yii’s performance. We will continue focusing more on the ease of use, features and documentation in the near future. When time comes for us to develop yii 2.0 (on PHP 5.3), we will revisit this.

1 Like

I totally agree.

I am more than happy with yii performances and I am also glad to say that we have chosen Yii for our next french large scale project in my company.

qiang, maybe it will be good to contact Fabien and make some corrections regarding it? Just not to confuse developers.

If we’ve started to discuss Symfony 2, I’d like to add my two cents and maybe to discuss it a bit.

I really like how routing is made. Parameters are bound by name and are passed to controller actions via named method parameters. Still don’t know how it’s done, but it looks very clean. If I remember correctly, Django does it the same way.

File structure, logger, class autoloading, bundles (except that Yii core is not divided too much) are very similar (conceptually) to what is in Yii.

I guess class method reflection is used to determine the parameter names. I am not sure if this is really good or not. It adds some hidden association between the method parameter names and the input parameters. If you modify the method parameter name by mistake, it will break the code.

It’s not really hidden. Parameter names are specified in routes almost the same way as in Yii’s $_GET parameters. And, I think it’s the same regarding mistakes: typo in $_GET[‘name’] leads to the same problem.

CakePHP did something similar with parameter names… I don’t really miss it though…

PHP 5.3 really isn’t supported by very many shared hosts yet unfortunately. At least not the ones I tried…

Looks similar to yii:

I think having the action method named indexAction is worse than actionIndex… don’t know why they do that.

Look how much typing was required for their simple route:

seems they got a few good ideas going tho

Slightly OT:

Your last link reminded me, why i ran far far away from Symfony some years ago: YML. I hated having to learn another syntax to create dynamic PHP code (at least that’s how i understood). Why not use PHP for that in the first place? That’s a big plus for Yii: I like that everything’s pure PHP (except maybe js for the client, but that’s a different story).

Moreover, the fact Yii is the fastest after their own framework, is pretty good.


Well, I don’t miss named parameters very much as well. It’s just another code style and it looks a bit cleaner.

Same about indexAction vs actionIndex. It’s just another style.

PHP 5.3 is not a big problem nowadays. There are many virtual private server hosting services and they are cheap.


According to Symfony 2 tests (that are not really fair), Yii is not faster.


I can agree about yaml. Too easy to make a typo.

In Symfony 2 they do have a good alternative to yaml — XML. There is validation and code completion.

As for PHP configs… well they are too much complicated in Symfony 2.

I hope we don’t become like YII fanboys…

Well, even if Symfony would run 100 times faster than YII, I wouldn’t use it again (after using it for two years).

I think it’s overcomplicated. And yes…I think YML and config files sucks too…

And btw, we don’t need to blame other frameworks…

Developers are free to choose what they want, and for us, YII is our choice (at least until we choose other framework that fits better to our needs)…

YII doesn’t need evangelists. Let’s show the world what YII can do developing sites with it…


Noone blames Symfony 2. Fabien did a really good job compared to Symfony 1 and there are some innovations too. We’re just discussing good parts of Symfony 2 and trying to imagine if they will fit Yii.

I’ve said it’s the fastest after Symfony 2, not that it’s faster than Symfony 2.

You know other than in a really broad sense these benchmarks aren’t worth very much, take a look at , the guy there shows how with four reasonably simple steps he gets Zend (whihc if you believe most benchmarks is slowish) to beat Symfony 2 in the benchmark.

Indeed - I’m sure I could produce a ‘test’ that would make any other framework appear faster (or slower) than Yii.

IMHO, the real questions are :

  1. Can I produce the application I need without re-inventing the wheel & without a mountain of redundant code sitting around the place.

  2. Can I do this quickly.

  3. Does my real-world application run fast enough to satisfy my prospective user group without upgrading my server hardware.

  4. Is the community for the framework I have chosen populated by smart people who are happy to help others (i.e. me).

Obviously, for Yii the answer to all 4 questions is a resounding YES :) - not so for most other frameworks …

(Oh, and yes, YAML sucks …)

Hear, hear.

Hmm i do like Symfony but like most im here because I hated the config files hehe ::) Speed is not everything…

Very cool though that all frameworks have adopted 5.3 now… ZF, Lithium, Symfony…

Lithium looks pretty cool now am eager to give it a test drive when i have some time

All this competition is absolutely fabulous … I expect great things when Yii will be refactored to take advantage of all the new PHP 5.3 enhancements (like Fabien Potencier did with Symfony 2)!