Re: [PHP] Question on code profiling

2009-07-27 Thread Andrew Ballard
On Sat, Jul 25, 2009 at 1:31 AM, Daniel Kolbo wrote:
> Andrew Ballard wrote:
>> On Thu, Jul 23, 2009 at 11:31 PM, Andrew Ballard wrote:
>>> From what I can tell, the numbers I see in WinCacheGrind
>>> look like they are off by about a factor of 10 pretty
>>> uniformly.
>>>
>>> Andrew
>>>
>>
>> Apparently the difference is indeed WinCacheGrind, as a number of
>> other people have left comments on the project site that the values it
>> reports need to be multiplied by 10. Now that I know the numbers are
>> "right" comes the fun part.  :-\
>>
>> Andrew
>>
> Is this factor of 10 business only for ZF on Windows IIS or for Linux too?
> thanks,
> dK
> `
>

It seems to be just an error in WinCacheGrind itself. It looks like
the "current" release was published more than 4 years ago, and the
latest post to the project feed was 8 months ago. There are even a
couple posts in the project feed that say you have to multiply
whatever time it displays by 10. I didn't notice the feed section
initially since I found the download link by following a link from the
xdebug site.

As for the performance of ZF itself, I have been extremely
disappointed with it running under the couple of Windows hosts I have
tried. I have had much better success with the couple sites I used it
with that were on shared hosting accounts using Linux servers.

Andrew

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Question on code profiling

2009-07-24 Thread Daniel Kolbo
Andrew Ballard wrote:
> On Thu, Jul 23, 2009 at 11:31 PM, Andrew Ballard wrote:
>> From what I can tell, the numbers I see in WinCacheGrind
>> look like they are off by about a factor of 10 pretty
>> uniformly.
>>
>> Andrew
>>
> 
> Apparently the difference is indeed WinCacheGrind, as a number of
> other people have left comments on the project site that the values it
> reports need to be multiplied by 10. Now that I know the numbers are
> "right" comes the fun part.  :-\
> 
> Andrew
> 
Is this factor of 10 business only for ZF on Windows IIS or for Linux too?
thanks,
dK
`

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Question on code profiling

2009-07-24 Thread Andrew Ballard
On Thu, Jul 23, 2009 at 11:31 PM, Andrew Ballard wrote:
> From what I can tell, the numbers I see in WinCacheGrind
> look like they are off by about a factor of 10 pretty
> uniformly.
>
> Andrew
>

Apparently the difference is indeed WinCacheGrind, as a number of
other people have left comments on the project site that the values it
reports need to be multiplied by 10. Now that I know the numbers are
"right" comes the fun part.  :-\

Andrew

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Question on code profiling

2009-07-23 Thread Andrew Ballard
On Thu, Jul 23, 2009 at 5:32 PM, Ben Dunlap wrote:
> I second Jonathan's suggestion; I would try calling microtime() before and
> after your database query, and before and after anything else that isn't
> strictly "execution of the script".
>
> Ben

I tried this where I could. (The ZF library itself is on a local
machine drive where I don't have access to edit the files, so I can
only edit files within the project itself. That means I can't inspect
too deeply.) I'm starting to think perhaps there is a bug in either
xdebug or WinCacheGrind. From what I can tell, the numbers I see in
WinCacheGrind look like they are off by about a factor of 10 pretty
uniformly.

Andrew

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Question on code profiling

2009-07-23 Thread Ben Dunlap
> Nope. Basically it connects to a database to load an ACL (which at
> [...]
> I thought xdebug was supposed to be a pretty good profiler. If it
> calculating the time correctly, where are the other ~3.6 seconds
> going?

One night I saw a script wait indefinitely for a response from a tanked
database, and PHP's max_execution_time trigger never fired to end the script,
even though it was set to a pretty low value. Some poking around led me to
http://us.php.net/manual/en/function.set-time-limit.php where I found this odd
note:

"Any time spent on activity that happens outside the execution of the script
such as system calls using system(), stream operations, database queries, etc.
is not included when determining the maximum time that the script has been
running. This is not true on Windows where the measured time is real."

The last sentence was particularly confusing because I was running on Windows.

At any rate, if xdebug is using the same mechanism used by set_time_limit() and
max_execution_time, perhaps that could explain your discrepancy?

I second Jonathan's suggestion; I would try calling microtime() before and
after your database query, and before and after anything else that isn't
strictly "execution of the script".

Ben
--
Twitter: @bdunlap

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Question on code profiling

2009-07-23 Thread Andrew Ballard
On Thu, Jul 23, 2009 at 4:51 PM, Robert Cummings wrote:
> Andrew Ballard wrote:
>>
>> I'm trying to profile a site on our development server to see why it
>> takes around 4 seconds to generate a pretty basic page. I installed
>> xdebug to use for the profiling, and now I'm really confused. Even
>> though it takes around 4 seconds to build the entire page, the profile
>> says that the total processing time is around 416ms. I thought it
>> might be calls to require_once/include/include_once. While they are
>> significant (around 46%), it says they only account for 193ms. What
>> could account for that much difference between what xdebug calculates
>> versus the total elapsed time?
>>
>> Andrew
>
> Any embedded remote elements in it like that punk Google analytics which I
> often see lagging my page requests on various sites?
>
> Cheers,
> Rob.

Nope. Basically it connects to a database to load an ACL (which at
this point is empty, so even that isn't doing much work) and spits out
"Hello World". I timed the page top-to-bottom using microtime to make
sure it wasn't network latency, and the elapsed time it calculated is
very close to the time I see displayed by the YSlow browser extension
(around 4 sec.). The server uses eAccelerator with both caching and
optimization enabled.

This is another one of those ZendFramework sites I'm setting up. (Last
time, I brought the execution time down considerably by moving the
framework from a network drive to a local drive, but that's already in
place this time.)

A simple  page executes very quickly (about
0.01seconds timed w/microtime, under a half second recorded in YSlow),
so I can't see that this could be held up any by IIS (yes, it's a
Windows server).

Even if the page is getting bogged down in calls to
include(_once)/require(_once), shouldn't that time still be reflected
in the profile calculation?

I thought xdebug was supposed to be a pretty good profiler. If it
calculating the time correctly, where are the other ~3.6 seconds
going?

Andrew

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Question on code profiling

2009-07-23 Thread Robert Cummings

Andrew Ballard wrote:

I'm trying to profile a site on our development server to see why it
takes around 4 seconds to generate a pretty basic page. I installed
xdebug to use for the profiling, and now I'm really confused. Even
though it takes around 4 seconds to build the entire page, the profile
says that the total processing time is around 416ms. I thought it
might be calls to require_once/include/include_once. While they are
significant (around 46%), it says they only account for 193ms. What
could account for that much difference between what xdebug calculates
versus the total elapsed time?

Andrew


Any embedded remote elements in it like that punk Google analytics which 
I often see lagging my page requests on various sites?


Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Question on code profiling

2009-07-23 Thread Andrew Ballard
I'm trying to profile a site on our development server to see why it
takes around 4 seconds to generate a pretty basic page. I installed
xdebug to use for the profiling, and now I'm really confused. Even
though it takes around 4 seconds to build the entire page, the profile
says that the total processing time is around 416ms. I thought it
might be calls to require_once/include/include_once. While they are
significant (around 46%), it says they only account for 193ms. What
could account for that much difference between what xdebug calculates
versus the total elapsed time?

Andrew

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php