AsyncScrollPortEvent as an WillPaintObserver causes extra layout flushes during page load
Categories
(Core :: Layout, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox69 | --- | fixed |
People
(Reporter: smaug, Assigned: emilio)
References
(Blocks 2 open bugs)
Details
(Keywords: perf:pageload)
Attachments
(4 files)
Reporter | ||
Updated•6 years ago
|
Assignee | ||
Comment 1•6 years ago
|
||
Reporter | ||
Comment 2•6 years ago
|
||
Assignee | ||
Comment 3•6 years ago
|
||
Reporter | ||
Comment 4•6 years ago
|
||
Assignee | ||
Comment 5•6 years ago
|
||
Comment 6•6 years ago
|
||
Assignee | ||
Comment 7•6 years ago
|
||
Comment 8•6 years ago
|
||
Assignee | ||
Comment 9•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Comment 10•6 years ago
|
||
Updated•6 years ago
|
Comment 11•6 years ago
|
||
Comment 12•6 years ago
|
||
bugherder |
Comment 13•6 years ago
|
||
Assignee | ||
Comment 14•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Comment 15•6 years ago
|
||
Assignee | ||
Comment 16•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Comment 17•6 years ago
|
||
Comment 18•6 years ago
|
||
Comment 19•6 years ago
|
||
Comment 20•6 years ago
|
||
bugherder |
Comment 21•6 years ago
|
||
Assignee | ||
Comment 23•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Comment 24•6 years ago
|
||
Hi Emilio! Just want to be sure this doesn't fall too far off your radar -- is this likely as simple as just re-landing (per comment 22)?
(I guess some rebasing may be needed, but hopefully this is set to go otherwise?)
Comment 25•6 years ago
|
||
Here is a try run based on the latest trunk with the patch for bug 1488953.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=8028e81e5c707b4383705e4b59086a43704afdec
It's mostly green on most platforms, but there are three failures, performance/browser_windowopen.js is timed out on Win10 x64 ASAN, browser_UrlbarInput_unit.js fails on Windows 7 and performance/browser_tabswitch.js fails on Windows 7. So I suspect there is something Windows 7 specific issue, but I no longer have any Windows 7 machines.
Comment 26•6 years ago
|
||
browser_UrlbarInput_unit.js creates a mock of the UrlbarInput, and it seems that it relies on the flush we are going to drop in this bug. Adding an explicit flush fixed the failure.
Drew, does adding the explicit flush sound reasonable?
Comment 27•6 years ago
|
||
Yes, it doesn't seem like that's related to what the test is testing, so that should be OK.
Comment 28•6 years ago
|
||
Oh could you include this bug number in the code comment please? Makes it a little easier to understand why it's there than searching through blame.
Comment 29•6 years ago
|
||
Thanks Drew! I will add some comments there and send a review request to you soon.
(Though in this bug there are other issues need to be solved)
Comment 30•6 years ago
|
||
Comment 31•6 years ago
|
||
Maybe the test failures will be disappeared by bug 1513325. CCing :ntim.
Assignee | ||
Comment 32•6 years ago
|
||
Doubtful, the urlbar already uses <html:input>
Comment 33•5 years ago
|
||
I did push a new try;
https://treeherder.mozilla.org/#/jobs?repo=try&revision=73561caefc2529469e9f314acaaa814bcfa983ca&selectedJob=248154218
The failure on Windows 7 have been passed for some reasons, instead browser_windowopen.js failed both on Windows 10/7 opt builds.
After poking around relevant places, I noticed that withPerfObserver doesn't work as expected, doesn't work as what browser normally does, because recordFrames calls drawWindow to take a screenshot and the drawWindow ends up calling FlushWillPaintObservers, thus it calls AsyncScrollPortEvent::Run then it calls FlushPendingNotifications which is exactly what this bug is going to drop. So, we inadvertently invokes an additional flush in withPerfObserver and the flush has been wallpapering some flickers which have been appeared (but unnoticeable I guess) on normal browsing.
As a proof of the wallpapering, I did push another try with skipping the FlushWillPaintObversers calls (and without any changes for this bug) when the snapshot is taken in recordFrames.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=4f955c05730c934016f5dae4da642bc8a6a18136&selectedJob=248918813
browser_windowopen.js actually failed and the result is pretty much the same as the failure with the changes for this bug.
mconley, does this sound a reasonable reason to add an exception in browser_windowopen.js test? (And I suppose the placeholder text movement is caused by the same root cause)
A note for Emilio : I didn't include the patch for bug 1488953 in tries since it causes another failure I am going to tackle the failures one by one.
Comment 34•5 years ago
|
||
If I understand correctly, we were always shipping this flicker, and for the reasons you identified, we weren't recording it properly for this test.
If that's the case, then yes, I think it makes sense to add an exception.
Comment 35•5 years ago
|
||
Thank you! I filed bug 1555842 for further investigation what the root cause of the urlbar flicker.
Comment 36•5 years ago
|
||
recordFrames has been wallpapering these flickers because the function ends up
calling FlushPendingNotifications in AsyncScrollPortEvent::Run() and we hadn't
noticed the wallpaper until we tried to remove the FlushPendingNotifications in
AsyncScrollPortEvent::Run().
Comment 37•5 years ago
|
||
The browser_windowopen.js failure appeared on MacOSX and Linux opt builds too ([1] for example), and oddly it appeared on Linux ASAN build. (I am wondering why it doesn't fail on any debug builds?) Anyways, I am going to apply the exception in D33226 to those platforms.
Updated•5 years ago
|
Updated•5 years ago
|
Comment 38•5 years ago
|
||
Comment 39•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5f35e6fc8f91
https://hg.mozilla.org/mozilla-central/rev/eddcd90c1ffa
https://hg.mozilla.org/mozilla-central/rev/cfac49a18cf1
https://hg.mozilla.org/mozilla-central/rev/a132736ab17e
Updated•3 years ago
|
Description
•