My first thoughts on Symfony2

I’ve been playing with Symfony2 for a little while now and I think I’m starting to get on top of it. When I started looking at Symfony2 I’d never used an ORM or a templating language before as well as not being versed in the features that PHP 5.3 introduced to the language. All in all it has been a very steep learning curve for me. If you are new to PHP frameworks or object oriented PHP then you can expect to feel thoroughly overwhelmed at first and it will take a lot of hours to produce something functional.

Having said all that – now that I’m starting to get my head around Symfony and I’ve made a few small basic apps, it really is quite a nice framework to code in. I really like the bundle system because it encourages you to make things in a reusable way. I can see in a few months that I will have my own bundle of bundles and that developing an app will be significantly faster as I’ll be able to drop in large amounts of functionality very very quickly.

I’m concerned about the performance of Symfony. It has the nick name “slowfony” for version 1 amongst performance oriented developers. I did some initial tests with caching completely disabled and the results were pretty bad. Even with APC I was only seeing 130 requests per second without hitting the database. I really need to spend more time understanding the caching aspects of Symfony so I can write a post on maximising performance.

4 Replies to “My first thoughts on Symfony2”

  1. Good to hear more PHP devs are looking at Symfony2! I’m doing so myself as well and it’s been pure joy so far. Discounting the moments of pulling my hair and swearing before I got it.

    Steep learning curve but totally worth it.

    I don’t get the slowness you’re experiencing though. Are you perhaps benchmarking the development environment?

    Symfony2 is *fast* from out of the box but the real beauty lies on how well you can optimize it. If you are not content with the speed of your site, Symfony2 gives you some really nice tools to boost its performance.

    1. Thanks for the comments Gents.

      As the post suggests I’m only just getting my head around Symfony2. Once I get some more time to play with the caching aspects of Symfony2 I’m sure I’ll get the performance I want out of the framework eventually. One thing that I’m really loving is the form builder and complex forms. I’m using app.php not app_dev.php, but other than that I haven’t really messed around with the configuration at all.

  2. interesting pov, sf2 is totally a mindset change. Performance is fast, did not use sf1 so i am unaware, but you should take a look at the latest Seldaek slides about performance, it rocks @ symfony day at cologne, the slides are online.

  3. You may be right to be concerned about performance, as other people have said, it’s not about how fast it is, it’s about whether its fast enough for you. For your traffic (or likely future traffic). For your app.

    I think you also have to consider the full feature set. Doing tests where you disable caching, or don’t use Edge Side Includes, doesn’t really help you anser the question because all those features are available to help the developer scale their app.

    I’m not commenting on the speed of Sf2, or on your own requirements. Just making the point. Don’t get hung up on the speed of the framework unless it is actually a problem for you. My own finding with sf 1.4 was that when load hit a point where I did need to move to use something like Varnish, it wouldn’t have mattered whether the framework was 20% quicker. I would have needed to think about using Varnish anyway.

Leave a Reply

Your email address will not be published. Required fields are marked *