Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-24-2007, 02:50 PM
Cristian's Avatar
Administrator
 
Join Date: Feb 2007
Location: Sibiu, Romania
Posts: 99
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...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-14-2007, 11:28 PM
Junior Member
 
Join Date: May 2007
Posts: 25
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-15-2007, 06:47 AM
Cristian's Avatar
Administrator
 
Join Date: Feb 2007
Location: Sibiu, Romania
Posts: 99
Default

Atm i think Zend_DB is quite complicated, personally i am using just a small subset.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-15-2007, 07:45 PM
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...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-16-2007, 02:13 AM
Junior Member
 
Join Date: May 2007
Posts: 25
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 05-18-2007, 04:05 PM
Drakos7's Avatar
Junior Member
 
Join Date: May 2007
Location: MD, USA, Terra, Sol
Posts: 4
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 11-14-2007, 03:09 PM
Junior Member
 
Join Date: May 2007
Posts: 22
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 01-08-2008, 11:15 AM
Member
 
Join Date: Aug 2007
Location: Sweden
Posts: 47
Send a message via MSN to Leif.Högberg
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:47 AM.