Open Bug 1426392 Opened 6 years ago Updated 6 months ago

Add reflow tests in ASAP mode

Categories

(Testing :: Performance, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: mconley, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: perf:responsiveness)

Our current reflow tests attempt to force consistency by dirtying the DOM every time a reflow occurs, and before any event handler runs, and waiting for _potential reflows_ to occur from script.

This is good for catching regressions - we never want to add _more_ potential reflows to these key interactions.

It doesn't, however, highlight the _real_ reflows that we're hitting that users might actually feel. The potential reflows are a superset of all reflows during the key interactions, and it's not immediately obvious which ones are most important to address.

Part of the problem here is the refresh driver - the refresh driver attempts to run at a ~16ms interval to do styles, ("natural") layout, and paint. It's run off of a timer, and is kinda non-deterministic. I don't think it's really possible to reliably say how many times the refresh driver will tick during a particular window of time.

florian had an idea to try to bring the more important synchronous reflows into relief: if we suspend the refresh driver (or rather, cause refresh to occur IMMEDIATELY after script has run), we can stop dirtying the DOM with nsIDOMWindowUtils.ensureDirtyRootFrame isn't necessary.

We're not suggesting removing the old reflow tests, but supplementing them with a richer collection of reflow tests that surface ones that users are likely to feel, as opposed to theoretical "potential" reflows.
An alternative to using ASAP mode (which opens the throttle on the refresh driver so that style/layout/paint occurs ASAP after the DOM is dirtied), we could also temporarily freeze the refresh driver using nsIContentViewer.pausePainting. This might be even more deterministic, since ASAP mode is ultimately still using a timer.
Whiteboard: [fxperf]
Whiteboard: [fxperf] → [fxperf:p3]
Severity: normal → S3
Component: General → Performance
Product: Firefox → Testing
Whiteboard: [fxperf:p3]
You need to log in before you can comment on or make changes to this bug.