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

Reply via email to