[Project_owners] Measuring page layout time

Brian King brian at mozdev.org
Thu Mar 15 08:19:53 PST 2007

On 13/03/2007 15:10 (CET), Michael Vincent van Rantwijk wrote:
> Brian King wrote:
>> A couple of browser questions:
>> It is pretty trivial to measure a page load time using a web progress 
>> listener, but does anyone know how to measure page layout time?
> Isn't nsIWebProgressListener.STATE_IS_DOCUMENT the one you are looking for?

So this is the start or end of document load? And what state do I 
measure it against?

>> On another note, how does one associate/store data for individual tabs 
>> when multiple are open, e.g. page load time?
> I would extend onStateChange in tabbrowser.xml for this and use 
> "this.mTab.myProperty = value;" over "this.mTab.setAttribute = value;"
> because setting attributes in XBL is slower (see Hyatt's comment in 
> nsBrowserStatushandler.js) and save the data as RDF in a new method or 
> some JS function.

This is effect is the same as gBrowser.mCurrentTab. I tried this as well 
as progressDOMWindow, but once you change tabs when a document is 
loading, all bets are off. What I mean is, if I load a page, and switch 
tabs before the page has finished loading, the listener for the loading 
tab does not get notified (it shifts to the new tab).
Brian King
www.mozdev.org - free project hosting for the Mozilla community

More information about the Project_owners mailing list