Page 1 of 1

Page processing time - view response headers

Posted: Fri 8. Jun 2007, 21:40
by jsw_nz
Wanted to ask for clarification here - since I am using a number of REP_TAGS - I wanted to view performance of page rendering time - I am thinking of trying to consolidate the tags in such a way as to make page rendering as fast as possible. Since Oliver has a enabled header output of page processing time at bottom of index.php - In Firefox I used the web developer tool:

Tools > Web Developer > Information > View Response Headers

It shows:
X-phpwcms-Page-Processed-In: 591.204 ms

However if I define the variable

Code: Select all

// retrieve complete processing time
list($usec, $sec) = explode(' ', microtime());
$time_processed = number_format(1000*($usec + $sec - $phpwcms_rendering_start), 3);
print 'X-phpwcms-Page-Processed-In: ' . $time_processed .' ms';
header('X-phpwcms-Page-Processed-In: ' . $time_processed .' ms');
and output it to browser as well it shows:
X-phpwcms-Page-Processed-In: 1,222.466 ms

Obviously the difference here needs explaining - since the Firefox extension is bypassing the full page rendering - is there an extension that allows me to see the header information as the page gets rendered?

Would LIVE HTTP headers do the job? -
Just asking...

DeXXuS - you there?
:)

Posted: Fri 8. Jun 2007, 22:52
by pepe
Hi NZ... try that:

open your index.php and go to the end:


// retrieve complete processing time
list($usec, $sec) = explode(' ', microtime());
header('X-phpwcms-Page-Processed-In: ' . number_format(1000*($usec + $sec - $phpwcms_rendering_start), 3) .' ms');

// START TEST for my good friend John in NZ ==========
echo 'Page-Processed-In: ' . number_format(1000*($usec + $sec - $phpwcms_rendering_start), 3) .' ms';
// STOP TEST for my good friend John in NZ ==========



EDIT :oops: :
Now... after trying it some more times (F5), i've realised, that every new test has a different time.... ???
So, my answer is non... :cry: And i have the same question as you :cry:
Pardon me John, but i've thought , i could help :oops: :oops: :oops:

Posted: Fri 8. Jun 2007, 23:11
by jsw_nz
Hi Pepe,

Yes - did that - so got an echo to browser
- the issue being the discrepancy between FF tool output (header)
- and actual output time to page itself (html)
- also noticing that IE spits out rendered page a wee bit faster....

just trying to optimize rep_tags stuff
- since each DB hit and preg_replace adds time

:) cold today in nz - send warm weather

EDIT
just read your edit - so question remains.... :)

Posted: Sat 9. Jun 2007, 00:43
by DeXXus
Hello my good friend!!!

I have installed several extensions that relate to what you are talking about:

Live HTTP Headers 0.13.1 - http://livehttpheaders.mozdev.org/
Don't ~think~ there's a timing mechanism, just http headers in real time (while pages are being "rendered"), it also allows you to edit request headers and replay an URL to observe any change in response. Can also filter out URL's with regexp for page calls you don't want to monitor and can exclude URL's that reference calls to filestype such as .js, .css, .jpg, .ico, ETC.

Header Spy 1.2.1 - http://addons.mozilla.org/en-US/firefox/addon/4276
Requires Live HTTP Headers be installed. Allows customization of above extension to display each different request/response header type in separate panels with differing sizes/layouts, ETC.

Tamper Data 9.8.1 - http://tamperdata.mozdev.org/index.html
Based off of Live HTTP Headers and allows more "tampering" with request/response headers. Shows individual and "running total" timing durations for events. Can graph these individually or in total. Also can export results as XML for further analysis or uses.

Load Time Analyzer 1.5 - http://addons.mozilla.org/en-US/firefox/addon/3371
Handy simple Google extension that has a mini toolbar showing overall page load time, number of events, select which events to monitor and graphs them with byte sizes and timings in execution order

Firebug 1.05 - http://www.getfirebug.com/
AWESOME "must-have" utility that does SO many things. One tiny part has a Net tab that shows the page events in a great "running total" graph (as you browse or refresh) which then allows you to dive down deeper into the actual contents of those request/response headers.

You should have Firebug installed EITHER way! :wink:
The others are just "gravy" for flexibility or experimentation.
The Google Load Time Analyzer toolbar gives a great "basic" quick visual feedback on page times.


I am sure that pepe and I have got your weekend "messed up" now. No fun for you! :P :D :twisted:

Posted: Sat 9. Jun 2007, 01:21
by jsw_nz
Awesome DeXXus
as usual at your encyclopedic best...

yeps ALL messed up now
definitely bookmarking this page
I do have Firebug - the rest is really good new info
:)
One tiny part has a Net tab that shows the page events in a great "running total" graph (as you browse or refresh) which then allows you to dive down deeper into the actual contents of those request/response headers.
still trying to find

UPDATE
Found

Just needed to update my Firebug extension to 1.0
definitely rocks
Also a great video from developer, Joe Hewitt
from this page:

http://yuiblog.com/blog/2007/01/26/vide ... t-firebug/

:)

Posted: Sat 9. Jun 2007, 02:00
by DeXXus
jsw_nz wrote: still trying to find
Mine is laid out like this:

Code: Select all

                                  |
                                  V
Console  HTML  CSS  Script  DOM  Net

Posted: Sat 9. Jun 2007, 02:11
by jsw_nz
Thanks DeXXus

The index.php rendering print script now coincides with the header script -

Code: Select all

print 'X-phpwcms-Page-Processed-In: ' . $time_processed .' ms';
header('X-phpwcms-Page-Processed-In: ' . $time_processed .' ms');
So firebug is accurate measure

:D