top | item 141845

Ask YC: A way to measure page render time?

5 points| tim2 | 18 years ago | reply

How do you measure the affect of different layouts on browsers' progressive rendering of pages?

12 comments

order
[+] ken|18 years ago|reply
I ran across this the other day: http://weblogs.mozillazine.org/roc/archives/2005/05/renderin...

If there was an easy way to run mozilla headless, e.g., "time moz-render-to-file <foo.html >foo.png", that would probably give you an idea (even better if moz could report timings itself). No idea how hard that would be to do, though.

[+] tim2|18 years ago|reply
Probably the best solution I've seen yet, although that has some big limitations.

What surprises me is that, in looking at all the browser rendering benchmarks online, everyone just seems to do it by hand! There must be some pragmatic way that the browser developers are benchmarking the browser speed.

[+] krishna2|18 years ago|reply
One more thing to do would be to add a start_time via js on the top of the page. Then, another at the tail end of the page - then use a javascript function to calculate the difference. This will give you the time for the server (or your web app). [You can also do some code to your controller or view - however you have it to generalize for all pages].

Now, this time is not the same as the time that firefox takes to display the page. For this, you will have to use the start time on head and then use a js function that will be called on body onload. This can now take the difference and show you the browser rendering time alone.

I have often seen that some pages get generated in the server in under half a second, but takes more than a few seconds for firefox to render. [For example, table with lots of rows, with lots of divs and esp. if there is any dynamic modification of nodes].

Another technique I use is to also display the times for both server/browser, only when I am logged in - and also use color codes to show the severity of the situation. [Like Green for under half a second, red for over a second..etc].

[+] prakash|18 years ago|reply
YSlow is good for measuring page render time, using your computer and internet connection and provider meaning it might not mirror where your end-users are coming from geographically and from a network perspective.

There are companies you can use to measure performance of a webpage from various geographies, networks, and internet connections available from pingdom, Keynote, Gomez and other companies

[+] tim2|18 years ago|reply
Unless I'm missing something, yslow just measures download size and latency.

I want to measure how well the browser progressively renders the page. For example if I made a layout with tables nested 50 deep, the browser would do worse at progressive rendering and have a higher render time than if I used just css.

Likewise, I'm not talking about network latency, eg pingdom, keynote(?). Or compatibility, eg gomez.

[+] krishna2|18 years ago|reply
I just noticed one thing. I added a comment directly. And was hoping that mine would probably go to the end of the list. But my response got inserted between posts by prakash and pg. Curious to see where this comment ends up.
[+] axod|18 years ago|reply
surely just put some js at the top of the html, to remember the current time, then set some js to be executed onload, and calc the difference?

Or are you not allowed to edit the code? :/

[+] pg|18 years ago|reply
Gmail does it apparently.