My last thoughts on Symfony2


Well I’ve been playing with Symfony2 for 3 months now and today is the day I’m officially turning my back on the Symfony project. I played around and built several small things just to see how it worked. I found it to have a brutal learning curve but maybe thats just me. Ultimately performance is what has driven my decision. I’ve heard the arguments “early optimization is one of the 7 deadly sins of programming” and “hardware is cheap”. All I have to say to both of those arguments is bollocks!

First off:

“early optimization is one of the 7 deadly sins of programming”
Sure, I can understand that – write your app, then optimize it. But your underlying framework should be absolutely optimized. If you start with a slow base guess what the outcome is going to be… a slow website/application. From what I’ve read online, Symfony2 is probably a huge performance increase over Symfony however when you strip Symfony2 down to its core framework without Doctrine or anything else and simple do:

 public function someAction() { return new Response('Hello World'); } 

I only got 950 requests per second, before adding on any baggage at all. I made a simple site, the homepage has 2 queries and thats it. 160 requests per second. Seriously? Someone posted on my other Symfony post that “you could pick another framework that is 20% faster….”, so lets look at some other frameworks for a second:

Out of the box, (H)MVC “Hello World” tests:

DooPHP: 8800 requests per second
FuelPHP (5.3 framework): 5000 requests per second
Codeigniter 2: 4800 requests per second
Kohana: 4000 requests per second
Yii: 3900 requests per second
Cake: 1300 requests per second

All tests were done on exactly the same server, running exactly the same software stack, and all taking network out of the equation. When you added network into the equation, my server was able to deliver about 700 requests per second of a full content index page of a website, still about 5 times more than the same page built in Symfony2 using 2 doctrine queries. The test machine is a 768MB of RAM, quad processor, virtual machine from Linode.

“Hardware is cheap”
I’ve heard this argument plenty of times. Sure the hardware might be cheap but that doesnt factor in the cost of the people required to make your application run on a multi server configuration or the cost of building and configuring that hardware to work well. Building multi server deployments comes with a whole host of challenges and most people don’t have an app that can scale horizontally at the flip of a switch. Funny that all the worst performing platforms all say “hardware is cheap”. Magento is a great example of this philosophy. Quite possibly the best marketing scam ever, Magento is a joke when it comes to performance. But I digress…

Symfony2 is slow, very very slow. Regardless of caching, the core framework is more than 5 times slower than FuelPHP (another 5.3 framework). If that is the sacrifice you are willing to make then good on you. Supposing you wanted to service hundreds of thousands of requests per day. With a performance driven framework you could do it with a single dedicated box which for arguments sake costs you $200 per month. With Symfony you’d be looking at $1000 per month. Thats an awful lot of additional tshirts, coffee mugs, or iphone apps that you’d have to sell each month just to pay your hosting (let alone the more specialised staff for multi server setups).

TL:DR
Symfony2, can I please get a credit for the last 3 months of my life. Thanks.