Federico Cargnelutti

Simple is better than complex. Complex is better than complicated. | @fedecarg

Which PHP framework is slower?

with 16 comments

There has been some allegations that PHP frameworks are slow, specially by those who used them to develop high-traffic Web sites. And lets be honest, when it comes to developing and scaling Web applications, performance is everything. Ekerete Akpan, from AVNet Labs, conducted a series of benchmarks to compare the performance of four popular PHP frameworks.

His report outlines the maximum requests-per-second limits imposed by the following frameworks: CakePHP, CodeIgniter, Symfony and Zend. The tests were run using httperf on a 1.8Ghz AMD sempron computer with 512Mb RAM running Ubuntu Gutsy (7.10) Desktop.

All scores are requests per second (higher is better):

Run 1

Run 2

Run 3

Run 4

Average

Baseline HTML

1327.5

1326.5

1328.6

1329.1

1327.9

Baseline PHP

331.6

332.1

331.4

332.0

331.8

CodeIgniter

21.5

21.2

21.7

21.7

21.5

Zend Framework

9.3

9.1

9.2

9.3

9.2

CakePHP

3.6

3.7

3.8

3.5

3.7

View all the tests

Written by Federico

July 2, 2008 at 12:03 am

Posted in Frameworks, PHP

16 Responses

Subscribe to comments with RSS.

  1. Where is Symfony in the grid ???

    Hugo

    July 2, 2008 at 7:10 am

  2. Good question, Symfony and Solar are missing. I’m tempted to benchmark a full application developed using Symfony, CakePHP and and Zend (all of them without an ORM).

    phpimpact

    July 2, 2008 at 8:33 am

  3. magento is powered by zend and it’s soooo slow! its full of bloated code. don’t waste your time or money getting paid support for it or expensive hosting. You will regret it. And yes, cake without ORM is much faster than zend.

    david

    July 2, 2008 at 9:18 am

  4. ZF is the new PEAR, I honestly don’t see people downloading 10.000 files just to build a web app.

    I’m quite shocked with the results, I thought Cake was faster than CI and ZF. Why is that?

    dnyce

    July 2, 2008 at 1:48 pm

  5. Was an op-code cache used? I always use APC (as I’m sure most people worried about performance would), so a benchmark using an op-code cache would be more relevant.

    Alvaro Carrasco

    July 2, 2008 at 5:02 pm

  6. Sorry, I actually went to the website and can see the results with and without cache.

    Alvaro Carrasco

    July 2, 2008 at 5:04 pm

  7. @dnyce You might not see it, but about 15,000 people download our distribution with ~2700 files every day. :) And that number is growing seemingly every day. :o Based on user feedback, we don’t feel that this is the most important characteristic of ZF to optimize. That said, we will be looking in to a leaner, meaner separate distribution soon that omits a lot of locale data, the unit tests, and the demos. If you’d like to see us go in a different direction with this, please join the mailing list and make yourself heard!

    @Alvaro We don’t plan on doing any serious performance tests without an opcode cache. Anyone who has any performance requirements should start with an opcode cache and go from there.

    Wil Sinclair

    July 3, 2008 at 12:53 am

  8. @Wil

    The only high-traffic site I know that’s using ZF and reported performance issues is fav.or.it:

    “We have had our issues with performance as we got closer to launch but this is always a risk when using a complex framework built by others”

    They mentioned performance issues and system complexity. That’s a very important feedback I would say.

    phpimpact

    July 3, 2008 at 9:02 am

  9. Scary stuff :-O

    Carrero

    July 3, 2008 at 10:53 am

  10. We are using Symfony for all our front-end web development. CakePHP and CI, unfortunately, do not support PHP5. Zend’s API is not very consistent and very difficult to learn. There’s a lot of functionality missing, you end up coding your own file uploader and image resizer, just to mention a few, and that slows down the development process.

    Zend, PEAR and ezComponents are not full-stack frameworks, like Symfony or Rails, they are libraries.

    Anyway, it’s always good to know what the realistic top limit is.

    Many thanks,

    Tibor

    Tibor

    July 3, 2008 at 9:16 pm

  11. Anybody tried Kohana yet? it’s an open source sibling of CI. (kohanaphp.com) Strict OO and PHP5 required. I am starting to learn it.

    Al

    July 4, 2008 at 12:46 am

  12. @Tibor:

    Did you read features before closing each framework website and writing stupid things? CakePHP does support PHP5, altough it brings support to PHP4 also, you are free to use objects as you like and want. Please, next time, read specifications before writing dummy text.

    Cheers.

    Martin Bavio

    July 5, 2008 at 5:20 am

  13. Hey Martin, how’s it going :) Are you going to the CakeFest this year?

    phpimpact

    July 5, 2008 at 7:03 pm

  14. tibor, if you didn’t want to write your own image uploader, you would choose a framework. Zend Framework is, rather confusingly and only according to my opinion, NOT a framework. It’s a library :-P

    In one application I use only Zend’s logger. In another I use probably 30 different components.

    I got a VERY good feeling from both CakePHP AND CodeIgniter, and if I wanted to work within a framework I would probably be using one of those right now.
    I feel that a library like Zend Framework gives me the flexibility to still have my application look and run how I want it, without having to write every single line of code by myself.

    I’m pleased to see that it has comparable performance to its alternatives, and I’m excited about what things we might see in the years to come!

    SneakyWho_am_i

    September 25, 2008 at 2:04 am

  15. The following page shows performance comparisons among more PHP frameworks:
    http://www.yiiframework.com/performance/

    shawc

    October 18, 2008 at 8:59 pm

  16. Christian Achatz

    February 24, 2009 at 6:10 pm


Leave a Reply