Last modified: 2014-10-17 11:42:31 UTC
Gergő Tisza suggested looking at chrome.loadTimes(), a nonstandard API that contains some interesting bits of data -- especially first paint time. We should log it.
Compared the results of loadTimes() with the standard navigation API by running $.each( performance.timing, function( key, val ) { if ( typeof( val ) === 'number' ) console.log( key, val - performance.timing.navigationStart ) } ); $.each( chrome.loadTimes(), function( key, val ) { if ( typeof( val ) === 'number' ) console.log( key, val * 1000 - performance.timing.navigationStart ) } ); - requestTime corresponds to navigationStart (with a few ms difference) - startLoadTime is connectStart - commitLoadTime is domLoading - finishDocumentLoadingTime is domContentLoadedEventStart (or ...End, doesn't seem to be any difference) - finishLoadTime is loadEventEnd (again, with a few ms difference) That leaves firstPaintTime and firstPaintAfterLoadTime. firstPaintTime comes after domLoading, but well before domInteractive/domContentLoaded*. On a vagrant box with just a few extensions, it comes 100ms after domLoading; on enwiki, the difference is 250ms. If it shows what its name suggests, it might be a good way of measuring the delay caused by head scripts. firstPaintAfterLoadTime follows loadEventEnd closely (probably too closely to be interesting - 5ms on plain vagrant, 50ms on enwiki). There is no data for first paint time after domcontentloaded, which would have been more interesting. Of the non-numeric fields, most are SPDY/NPN related. navigationType is similar to performance.navigation.type, but judging from the source code ( https://src.chromium.org/svn/trunk/src/chrome/renderer/loadtimes_extension_bindings.cc ) it has more values: link clicked / form submitted / form resubmitted / history / reload. Not useful since logging is disabled for most of these anyway. So firstPaintTime and maybe firstPaintAfterLoadTime seem to be the only useful ones.
An interesting post about first paint vs onload and the shortcomings of both: http://calendar.perfplanet.com/2012/moving-beyond-window-onload/ Also, while looking for a description of chrome.loadTimes() (which does not seem to exist - pretty much the on), I found this tool, which seems to be pretty cool: http://www.lognormal.com/boomerang/doc/ The developers of boomerang also wrote an article about how to measure paint timing on other browsers: http://webcache.googleusercontent.com/search?q=cache:www.lognormal.com/blog/2013/11/11/calculating-first-paint/
Change 132764 had a related patch set uploaded by Gergő Tisza: Log paint times https://gerrit.wikimedia.org/r/132764
Change 132764 merged by jenkins-bot: Log time of first paint and first paint after onload event https://gerrit.wikimedia.org/r/132764
(In reply to Gerrit Notification Bot from comment #4) > Change 132764 merged by jenkins-bot: > Log time of first paint and first paint after onload event > > https://gerrit.wikimedia.org/r/132764 Patch was merged - assuming this bug is FIXED. If that is not the case: Please reopen and elaborate what is left to do here to get this report fixed.