Indeterminate progress bar causes too much display list building in Thunderbird
Categories
(Core :: Web Painting, defect, P3)
Tracking
()
People
(Reporter: mounir, Unassigned)
References
(Blocks 2 open bugs,
URL
)
Details
(Keywords: perf, Whiteboard: [battery][tpi:+])
Comment 1•13 years ago
|
||
Comment 2•13 years ago
|
||
| Reporter | ||
Comment 3•13 years ago
|
||
Comment 4•13 years ago
|
||
Updated•10 years ago
|
Comment 5•9 years ago
|
||
| Reporter | ||
Comment 6•9 years ago
|
||
Comment 7•9 years ago
|
||
Updated•8 years ago
|
Comment 8•7 years ago
•
|
||
I can reproduce it in Thunderbird, and have a workaround by getting rid of progress bar and throbber, see bug 562977 comment 60
Comment 9•4 years ago
|
||
Hey Mounir,
Can you still reproduce this or should we close it?
Comment 10•4 years ago
|
||
Regardless of whether Niklas responds, this is still widely reported for current versions of Thunderbird. ref bug 562977 and friends.
It's quite a problem for Linux users.
Do we need a different implementation of progress bar?
Comment 11•4 years ago
|
||
How is progressmeter implemented, just like <progress>? Do you have a profile? If time is spent in gtk drawing it would be a different thing than comment 0. The code goes through QueueAnimatedContentForRefresh which in fact just uses a timer to animate, which is a bit unfortunate: https://searchfox.org/mozilla-central/rev/8b46752d1e583b2f817c451f93ba515fb865554d/widget/nsNativeTheme.cpp#456
Comment 12•4 years ago
|
||
Geoff, can you anwser part of comment 11?
Walt, can you create a performance profile?
Comment 13•4 years ago
|
||
(In reply to Wayne Mery (:wsmwk) from comment #12)
Walt, can you create a performance profile?
What is $URL, and how do I open it, or do I just run Thunderbird and check for mail?
Comment 14•4 years ago
|
||
Thunderbird and do anything that causes the status bar to churn. Even better if you find something where the status bar just won't stop - - possibilities include Bug 1098069, and password prompts.Unfortunately I don't have a foolproof method.
profiler.firefox.com
Comment 15•4 years ago
|
||
Going where no WaltS48 has gone before, and following the instructions at Profiling Thunderbird Performance.
This is what I got using the latest Thunderbird 91.5.0 from Fedora on Fedora 35 Workstation.
https://share.firefox.dev/36LAOJT
Hope it helps.
Updated•4 years ago
|
Comment 16•4 years ago
|
||
Redirect a needinfo that is pending on an inactive user to the triage owner.
:stransky, since the bug has high severity and recent activity, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•4 years ago
|
Comment 17•4 years ago
|
||
In the process of migrating remaining bugs to the new severity system, the severity for this bug cannot be automatically determined. Please retriage this bug using the new severity system.
Comment 18•1 year ago
•
|
||
There's something mad about the HTML progress widget that causes it to repaint just about everything. I created a pair of <div>s in the same location as the status bar progress meter, styled them to look identical, and created these performance profiles: https://share.firefox.dev/3PFjLvS
I've also noticed there's much less activity if the message list has only a few messages in it. This shouldn't affect it.
Comment 19•1 year ago
|
||
I don't think is unique to GTK. I see similar high CPU usage on Mac, but not on Windows.
At the moment I'm considering just replacing the status bar <progress> with a custom element, as it seems to be the only one where this is a major problem.
Comment 20•1 year ago
|
||
Emilio, hopefully my profile in comment 18 offers something worth investigating. I think this bug has become more painful since we updated the UI in 115. It's definitely present in a lot of the performance profiles I see.
Comment 21•1 year ago
|
||
So... That only shows a lot of display list building time. It also no longer seems to use the native animation, so this is no longer a widget problem afaict.
This is using a background-position animation. An opacity or transform animation would be faster, and that'd be my recommendation. But still it seems like retained display lists should do better, we seem to be rebuilding a whole lot of stuff, unnecessarily...
So TLDR: On your end, I'd look into using transform to implement that animation rather than a background-position animation. Seems it should be doable by moving the radius to the <progress> element?
On our end, it seems retained display lists should do better to avoid rebuilding the whole thing. Tim, do you know how to go about debugging that?
But anyways both problems seem to be unrelated to the original issue which was about the native progress bar.
Comment 22•1 year ago
|
||
(In reply to Geoff Lankow (:darktrojan) from comment #18)
There's something mad about the HTML progress widget that causes it to repaint just about everything. I created a pair of <div>s in the same location as the status bar progress meter, styled them to look identical, and created these performance profiles: https://share.firefox.dev/3PFjLvS
I've also noticed there's much less activity if the message list has only a few messages in it. This shouldn't affect it.
This is in Thunderbird? Is it easy to create a testcase that reproduces the problem in Firefox too?
From the profile it doesn't look like we are throwing away the display list and rebuilding the full thing again, so that would mean we are expanding the rect to rebuild to probably the whole window based on the frames marked modified. Enabling CRR_DEBUG here
https://searchfox.org/mozilla-central/rev/86c208f86f35d53dc824f18f8e540fe5b0663870/layout/painting/RetainedDisplayListBuilder.cpp#869
will give a lot of output and might explain why things are expanding so much.
Comment 23•1 year ago
|
||
Actually the profile linked from that comment now is one that uses transform. I replaced the earlier one. That was silly in hindsight. The transform version does perform a bit better than the background-position version.
I've just started fresh and moved the background animation up to the main progress element. There's no improvement.
But anyways both problems seem to be unrelated to the original issue which was about the native progress bar.
Yeah. AIUI the current style on the widget was implemented to avoid this very issue, but actually it's made it worse in my testing. Maybe it was an improvement at the time. The native widget still isn't great performance though. https://share.firefox.dev/4jdNqtV
Comment 24•1 year ago
|
||
(In reply to Timothy Nikkel (:tnikkel) from comment #22)
This is in Thunderbird? Is it easy to create a testcase that reproduces the problem in Firefox too?
Yeah, this in Thunderbird. I think this bug's always been about Thunderbird, if not it got hijacked around comment 4.
From the profile it doesn't look like we are throwing away the display list and rebuilding the full thing again, so that would mean we are expanding the rect to rebuild to probably the whole window based on the frames marked modified. Enabling CRR_DEBUG here
https://searchfox.org/mozilla-central/rev/86c208f86f35d53dc824f18f8e540fe5b0663870/layout/painting/RetainedDisplayListBuilder.cpp#869
will give a lot of output and might explain why things are expanding so much.
I'll see what I can find out.
Comment 25•1 year ago
|
||
With the progress meter in indeterminate mode, these lines were printed over and over again. I assume that's once every time it painted.
Processing frame 7054c84e8238 with agr 7054cab9f020
currentFrame: 7054c84e8238 (placeholder=0), aOverflow: 0 0 8000 240
Adding area to root draw area: 36378 61650 8000 240
Setting 7054cab9f020 as root stacking context AGR
Computing rebuild regions for 1 frames:
Considering OOFs for 7054c84e8238
Considering OOFs for 7054c84e8180
Considering OOFs for 7054c84e80c0
Considering OOFs for 7054c84df8c0
Considering OOFs for 7054c84df800
Considering OOFs for 7054c84df740
Considering OOFs for 7054c8459438
Considering OOFs for 7054cab9f268
Considering OOFs for 7054cab9f1a8
Considering OOFs for 7054cab9f0d0
Considering OOFs for 7054cab9f020
The same thing is logged with all of our CSS removed, except the overflow and draw areas are different. (Assuming that's x, y, width, height that makes sense as the widget is taller with the CSS gone.)
currentFrame: 798cea24e238 (placeholder=0), aOverflow: 0 0 8000 800
Adding area to root draw area: 36378 30170 8000 800
Comment 26•1 year ago
|
||
That seems reasonable, the rects seem like we are invalidating the correct area. To be sure you could check modifiedDirty at this line https://searchfox.org/mozilla-central/rev/b19c379ba7b6d4f25af090a66cec3facf8153ee3/layout/painting/RetainedDisplayListBuilder.cpp#1626 to make sure it is also small. The rect is in appunits, depending on your screen divide by 60 or 30 to get pixels usually.
It might take a long time to build the display list because the structure of the window is complicated.
If the progress bar can be animated using something that can be animated off main thread that would avoid the display list builds.
Comment 27•1 year ago
|
||
(In reply to Timothy Nikkel (:tnikkel) from comment #26)
That seems reasonable, the rects seem like we are invalidating the correct area. To be sure you could check modifiedDirty at this line https://searchfox.org/mozilla-central/rev/b19c379ba7b6d4f25af090a66cec3facf8153ee3/layout/painting/RetainedDisplayListBuilder.cpp#1626 to make sure it is also small. The rect is in appunits, depending on your screen divide by 60 or 30 to get pixels usually.
The dirty rectangle is the right size.
It might take a long time to build the display list because the structure of the window is complicated.
Yes, it definitely takes longer when there's a lot of messages in the message list vs an empty list.
If the progress bar can be animated using something that can be animated off main thread that would avoid the display list builds.
That's the thing, I recreated effectively the same thing using two divs, and it does avoid the builds. What's weird about the progress element that it's animated on the main thread? Is it because it used to be a native widget?
Updated•1 year ago
|
Updated•1 year ago
|
Comment 28•1 year ago
|
||
If the repaint area is correct but display list building still descends into the table of messages, it's worth finding out why that happens. Does the table's visual overflow rect intersect the dirty rect?
Just as an experiment you could try to add contain:paint to the table area.
Comment 29•1 year ago
|
||
Going to consider this a duplicate of Bug 1971648 - Add contain: strict to pane elements to reduce layout complexity, and avoid performance impact from animation in status bar - with status bar enabled this should be fixed in 141.0, and to be fixed in esr 140.3.1.
Version 142.0 has additional performance fixes, which will also be in esr 140.3.1.
Description
•