Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Zend Framework Performance

  1. #1
    Cristian's Avatar
    Cristian is offline Administrator
    Join Date
    Feb 2007
    Location
    Sibiu, Romania
    Posts
    130

    Default Zend Framework Performance

    Hello,

    I am starting this thread after some talks i had some time ago on other forums (before to start our dedicated Zend Framework forum)...

    As far as I tested until now, because of multiple reasons, performance of Zend Framework for very intensive sites is not quite good atm.

    I posted also on Zend Framework Tutorials site a link to a great benchmark made for multiple frameworks, by Paul M. Jones, on his blog:

    New Year’s Benchmarks « View TutorialÂ*

    So, performance problems with Zend Framework there are because:
    - PDO layer is adding some overhead
    - since is not at 1.0 version at least now development is more important than optimize/clean
    - also, since basically Zend Framework is yet another layer will add more overhead...

    I tested myself for some sites i am doing, some of them with lot of pages displayed (milions/month) aka lot of Zend Framework things done behind (especially if on database side)... Until now i didn't used at all MVC side of Zend Framework, i preferred my own approach, which means with MVC will be probably more overhead...

    So, after i upgraded some of sites to Zend Framework i saw servers loading increasing a lot, now i need to upgrade one of webservers because he can't handle anymore one of the sites...

    But, thing is this overhead maybe is not/will be not overhead because:
    a) i think Zend Framework is adding a "safety" layer which was not before made, or was made with third party components, without to be sure about a quality level

    Let's give you a quick sample: i think almost all PHP developers used sometime "HTML Mime Mail for PHP", which is widely used into web. Problem is i personally think this component rather made more problems than helps because is not protecting at all against mail injection. I also think should be rather put offline due to this security risks, or at least a warning should be. Not everyone knows what is mail inject, and how to treat, aso.

    So, better to have extra overhead with extra safety... And i think Zend Framework would be continuously updated, so security risks could be eliminated... Anyway, developers should update their Zend Framework installations from time to time...


    b) i think applications are more easier to develop with just one "tool" (OO tool) instead of spending lot of time with integrating lot of third party tools, or develope your own (which you would see that ae outdated after a while); Also, this integration/easier usage will attract also newbie developers to a more modern programming style, and as i said before, more "safe"

    c) performance will increase i think if after 1.0 version we're going to have some optimizing, code cleaning... Probably not much, extra-facilities added in time aso will probably tend to slow things...


    So, overall, prepare for some hardware upgrades, but also prepare for doing better, safer, more easier to develop web applications...

  2. #2
    frosty1 is offline Junior Member
    Join Date
    May 2007
    Posts
    28

    Default performance

    i compared comparable code in ruby on rails and zen framework. zf had a small advantage.

    one thing i have noticed is the longest query is always the describe table. some way of caching this might help?

  3. #3
    Cristian's Avatar
    Cristian is offline Administrator
    Join Date
    Feb 2007
    Location
    Sibiu, Romania
    Posts
    130

    Default

    Atm i think Zend_DB is quite complicated, personally i am using just a small subset.

  4. #4
    jap
    jap is offline Junior Member
    Join Date
    Apr 2007
    Posts
    23

    Default

    Quote Originally Posted by Cristian View Post
    Atm i think Zend_DB is quite complicated, personally i am using just a small subset.
    Complicated,
    does that mean it also uses more memory etc than actually necessairy?

    Would a "Lite" version be handy with only the basic elements of ZF included in the system?

    It's just something that came up in me... I don't know it would have any use...

  5. #5
    frosty1 is offline Junior Member
    Join Date
    May 2007
    Posts
    28

    Default strip out what you dont need

    you can always delete the parts of lib that you dont use. only a few are critical.

    i did some calculating, and 2500 complete zf sites (with content, images, database, etc) could fit on my server with a lot of room to spare, so size really should not be that much of an issue.

  6. #6
    Drakos7's Avatar
    Drakos7 is offline Junior Member
    Join Date
    May 2007
    Location
    MD, USA, Terra, Sol
    Posts
    7

    Default

    I did some testing of Smarty integration with ZF using apache bench. With Smarty the transfer rate was 50% slower on a simple small table (4 column, 7 row) than just using the Zend View method. For a large table (17 column, 2970 rows) it was 80% slower. Just food for thought.

  7. #7
    albeva is offline Junior Member
    Join Date
    May 2007
    Posts
    26

    Default

    bringing dead topic to life...

    but 1.0 has arrived and speed issue hasn't imroved much at all. What are the techniques to imrove the speed? from what I see falf teh time to generate teh response is taken by including all the files needed. And plethora of config options also means complications and slower overal execution of the zf.

    on my pc it takes nearly 0.5 seconds to compose the website while including all the files needed takes about 0.3 of it. I've no idea what todo anymore because I fear once site is live it will generate considerable overhead for the server.

  8. #8
    Join Date
    Aug 2007
    Location
    Sweden
    Posts
    52

    Default

    You fail to mention if you use any kind of caching in your benchmarks. Assuming you don't, the easiest way to improve your performance is to use a byte code cache for your code and query/memory -caching for your database.

    Another good practice is to manualy add the include/require statement to files instead of relying entirely on autoload to do the job for you. (I know this one is hard since autoload is sweet like the nectar of ambrosia) Although this is only useful if the included code is always used by the code in the file. (In which case you should use require_once anyway). A good example of when this practice should be used is class inheritance.

    Even with a byte code cache the framework will add some overhead due to its file structure. If further performance improvement is required one way (although tricky) of squeezing some extra performance out of your site would be to write an application that would replace any include/require statement with the actual code to be included where ever possible. One would have to take care not to include the same file more than once tho.

    Note that you would run this program on your code before you uploaded it to your live server. This way you would have the benefit of code separation while working on the code and the benefit of not having to parse multiple files when serving pages to your audience.

    Before you ask, no I haven't actually done this (the include replacing app that is) myself. But I have read that some of the big fish out there in the world do this.

    Hope this helps.

  9. #9
    danprep is offline Junior Member
    Join Date
    Feb 2009
    Posts
    3

    Default One of the approaches to increase performance

    Hello, if you're after performance, here is an article explaining how to enable conditional get for zend framework website, increasing performance to end users

    Enabling Zend Framework app with conditional get

  10. #10
    aselvais@gmail.com is offline Junior Member
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    6

    Default speed up ZF 2 quick tips

    Here are 2 quick tips to speed up ZF:

    1. Use APC (you would be crazy not to use it!)
    2. Mount a mem drive and copy the ZF in it

    I wrote a small article about that :
    Antidot Inc. Canada - Internet services

    I hope it helps somebody

Page 1 of 2 12 LastLast

Similar Threads

  1. Zend Performance Issue
    By zend_crazy in forum Concepts, Ideas, Planning
    Replies: 3
    Last Post: 03-14-2010, 06:23 AM
  2. Zend Framework random slow pageload performance question
    By suzysatsuma in forum General Q&A on Zend Framework
    Replies: 1
    Last Post: 12-02-2009, 10:15 PM
  3. Article about performance improvement for Zend Framework
    By danprep in forum Resources for Developers
    Replies: 0
    Last Post: 02-10-2009, 08:37 AM
  4. Zend Framework Performance
    By bbrian in forum General Q&A on Zend Framework
    Replies: 9
    Last Post: 01-10-2009, 04:12 PM
  5. Framework Performance Comparisons
    By pangpond in forum General Q&A on Zend Framework
    Replies: 7
    Last Post: 10-13-2008, 01:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •