On 10/11/07, Dennis Fogg <[EMAIL PROTECTED]> wrote:
>
> I completed the basic structure of my ZF infrastructure
> and noticed that it seemed quite slow.
<snip>
> 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
<snip>
> 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.

Hi Dennis,

First, if you want to profile ZF vs. <somethingelse> you'll have to
factor out anything that isn't specific to ZF like the database and
how PHP is invoked (you don't mention what web server you're using).

But if I had to guess I'd be suspicious of Windows. My understanding
is that PHP simply doesn't run very well on Windows. In fact MS just
released some IIS FastCGI thingy that's supposed to speed things up
considerably (that's what they claim anyway).

A simple Zend_Controller request on a Linux machine using 'time wget
<url>' takes ~0.11 seconds. To see if your problem is something with
the PHP stack, time the following script:

<?php
echo "Hello, World";
?>

On Linux this takes ~0.013 seconds timed from a shell like $ time wget
http://www...test.php.

Finally, ZF is a sophisticated OO framework so, yeah, there's going to
be some overhead (of what looks like about 0.1 seconds just for ZF
without the DB calls). But I think it should be very possible to keep
real production requests under 0.25 seconds with ZF which I think is
very reasonable. Look at ZF sites like zend.com. Is it fast enough for
you?

Mike

-- 
Michael B Allen
PHP Active Directory SPNEGO SSO
http://www.ioplex.com/

Reply via email to