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