Back in September, Till shared an update [1] from dev-platform about the Progressive Web Metrics that the Blink team is championing. I've been looking into how that effort is going in Firefox and Blink, and whether we should be adopting some of them.

Overview:
We should implement the Time to First Paint, Time to First Contentful Paint, and Time to Interactive measurements, focusing on integrating them with fitzgen's graphical profiler tool. The specifications make use of the PerformanceObserver web API which we don't implement yet; if we're keen on using these measurements to compare testcases against other browsers, we should rectify that. It will not make it easier to compare measurements for arbitrary web content, however.

Long form:
In brief, some of the measurements have pretty clear definitions and would be worth integrating into Servo in Q2. Others are still being hashed out and wouldn't clearly provide value to us at the moment.

Time to First Paint and Time to First Contentful Paint [2] are conceptually straightforward. Respectively, they measure the number of milliseconds before the browser paints anything that is not the default white background, and the time before the browser paints any text, image, non-white canvas, or SVG.

Firefox has already implemented Time to First Paint [3]. I think we'll get the most value out of this measurement by focusing on the interaction with our graphical profiler timeline tool, rather than the integration with the new PerformanceObserver API [4].

Time to Interactive takes a different path. It attempts to measure the amount of time before a page is ready for interaction, and has low enough latency for meaningful interaction to occur. It tracks 10 second windows in which no script thread task takes longer than 50ms to complete. If a task takes longer, then the window is reset. To determine readiness, the official write-up [5] uses the Time to First Meaningful Paint metric (not discussed here), but there have also been experiments using the DOMContentLoaded event for this purpose (ie. the page has finished parsing). I propose implementing an initial version of this metric in Servo using DOMContentLoaded as the signal.

Together, these metrics will give us information on the graphical timeline showing: * how long after a page was requested before the first visual change occurred
* how long after that before the first nontrivial visual content appeared
* how long after the page was requested before it was in a state that could respond to user input with low latency

If there are no objections, I intend to make implementing these part of our Q2 goals.

Cheers,
Josh

[1] https://groups.google.com/d/msg/mozilla.dev.platform/Ot43qpeWyos/x20WdRnxBAAJ
[2] https://github.com/WICG/paint-timing#definition
[3] https://bugzilla.mozilla.org/show_bug.cgi?id=1307242
[4] https://w3c.github.io/performance-timeline/#dom-performanceobserver
[5] https://github.com/tdresser/time-to-interactive
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo

Reply via email to