I completed the basic structure of my ZF infrastructure 
and noticed that it seemed quite slow.
So, I did some performance profiling and used some
performance tools only to find that ZF is pretty slow for me:
a blank page takes 1.3 sec to load.
I'm pretty new to performance tuning so I'm seeking advice.

I'm testing the performance of a web page that just has a few
words on it.  It also does a Smarty include of a header page
with a few words.  The PHP script does connect to my db.

Performance techniques I've already included:
-postgres db uses persistent connections
-postgres db has ssl connection turned off in postgresql.conf
-use eAccelerator as opcode cache

My ZF infrastructure currently does the following:
-sets up Zend_Loader
-sets up registry, config_ini, Zend_translate, Zend_log
-sets up db connection and does an actual connect 
-sets up zend front controller
-sets up Smarty views
-dispatches and displays blank page


Over 20+ runs, I got the following data:

.57 sec (44%) for db connection even though it's persistent connection
.26 sec (20%) for Zend_Controller_Front::getInstance() call
.23 sec (18%) for $f_ctl->dispatch() call
.06 sec (5%) for $f_ctl->setControllerDirectory(<hard coded path>) call

1.30 sec (100%) for complete php script to run

All of these times are wall clock times via xdebug_time_index().

I also ran xdebug and generated a cachegrind profile and the
times were very different:
wincachegrind says the cummulative time is 147 ms 
(not 1300 ms which is the wall clock time).
I'm not sure why there is so much difference between the times.
(does the cachegrind file only measure the php time?)
Some data from WinCacheGrind:

0 ms cumm time for Zend_Front_Controller::getInstance (5 calls)
23 ms cumm time for Zend_Front_Controller->dispatch (1 call)
5.2 ms cumm time for Zend_Front_Controller->setControllerDirectory (1 call)


All of this was run on my laptop as the web server:
1.2 gb ram, 1.6 ghz single core, 7200 rpm disk, 
Windows XP, php 5.2.3, postgres 8.2, 
Zend Framework 1.0.2
and I used a different PC as my browser client.

My questions/concerns are:
-the db connection time is as fast as I can get.
 I've come to accept that.
 See
http://beach-blogger.blogspot.com/2007/09/zend-framework-postgres-vs-mysql.html
-both instantiating the front controller and dispatching
 the page are taking a huge amount of time ... why??
-even the single setControllerDirectory() method call
 is taking much more time than expected...
-why do the wall clock time and the cachegrind time differ
 so much?


-- 
View this message in context: 
http://www.nabble.com/ZF-performance-advice-tf4610974s16154.html#a13167829
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to