Until recently our state of the art method for measuring startup was to subtract a timestamp passed via commandline from a
new Date() timestamp within a
<script> tag. Vlad pioneered this approach, me and others adopted it.
Turns out there are two problems with this approach:
- It is cumbersome, especially on Windows where there is no easy way to pass a timestamp via the commandline.
- It is wrong. Turns out that Firefox starts loading web pages before the UI is shown. One can’t be sure that the page being loaded is within a visible browser
Our oldest startup benchmark, ts, has been gathering wrong numbers all along. This resulted in a class of perverse optimizations that decreased the ts number, but increased the time taken for UI to appear (ie bug 641691). The new tpaint (bug 612190) benchmark should should address this. On my machine measuring pageload vs paint-time results in a 50-100ms difference. See the graph server for more data.
This is why AMO’s complicated method of measuring startup is wrong. Please use our shiny new about:startup extension or if you absolutely want to avoid adding any overhead use getStartupInfo API directly.