Is the firstPaint timestamp in nsIAppStartup's getStartupInfo[1] not sufficient? It's apparently recording the time that firstPaint occurred. I think you're already aware of this, but I'm in the process of modifying ts_paint to record the delta between the firstPaint timestamp and the process start timestamp in bug 1287938.
If it's not sufficient, I'd like to understand why. As for MozAfterPaint firing all over the place - you might find this useful: https://groups.google.com/forum/#!searchin/mozilla.dev.platform/MozAfterPaint/mozilla.dev.platform/pCLwWdYc_GY/j9A-vWm3AgAJ See the second example I wrote in https://developer.mozilla.org/en-US/docs/Web/Events/MozAfterPaint#Example Is any of that helpful? -Mike [1]: https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIAppStartup#getStartupInfo() On 21/07/2016 11:38 PM, zbranie...@mozilla.com wrote: > As part of the work we're doing to replace old l10n API (DTD for HTML/XUL and > StringBundle for JS) with new API, we're trying to measure the performance > cost of DTD, StringBundle and its replacements. > > The challenge we encountered is that there doesn't seem to be a way to > measure something that I'd intuitively and naively would call "first paint". > > By first paint, I mean the moment when the engine paints the UI for the first > time. > > I'd expect there to be some way to get it via Performance API, or some > Mozilla-specific event, but everything I see does not seem to do this. > > MozAfterPaint reports every paint, and it fires before DOMContentLoaded, > between DOMContentLoaded and window.onload, and after. It's impossible to > say, which one of them marks the event I'm after*. > > bz created a POC of an API for us that pauses frame creation (**) and that's > awesome as it ensures that we will not cause FOUCs, but now we need to > measure when the "first paint" happens with our code vs. with DTD and I don't > know how to get the required event. > There seems to be `widget-first-paint` event (***) but if I understand it > correctly it'll only mark when chrome window is painted for the first time, > now a document. > > Can someone help us? If we have to add it, where? > > Thanks, > zb. > > > *) And it's not the first. I can reliably modify visible DOM after first > MozAfterPaint and I will not have FOUC. > **) https://bugzilla.mozilla.org/show_bug.cgi?id=1280260 > ***) > https://dxr.mozilla.org/mozilla-central/source/layout/base/nsPresShell.cpp#9157 > _______________________________________________ > dev-platform mailing list > dev-platform@lists.mozilla.org > https://lists.mozilla.org/listinfo/dev-platform > _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform