Open Bug 1677380 Opened 2 years ago Updated 1 month ago

Thunderbird 78.4.x account list / folder pane slow to scroll on MacOS 10.15 - high CPU in FrameLayerBuilder::PaintItems. Not better with HWA disabled. Better with Webrender.

Categories

(Thunderbird :: Mail Window Front End, defect, P2)

x86_64
macOS

Tracking

(thunderbird_esr78? affected)

Tracking Status
thunderbird_esr78 ? affected

People

(Reporter: nikolaev.makc, Unassigned)

References

(Regression)

Details

(Keywords: perf, regression)

Attachments

(1 file)

On Thunderbird 78.4.3 (64-bit) left pane ( mailboxes and folders ) very laggy and Jumpy scrolling. High CPU usage 70-100%

Thunderbird 78.4.3 (64-bit)
macOS Catalina 10.15.7 (19H2)
MacBook Pro (13-inch, 2020, Four Thunderbolt 3 ports)

I have 8 mailboxes ( +- 30 folders and 100 subfolders per mailbox , mostly minimised ) . On 77.x not reproducing.

Attached image shows CPU when scrolling mailboxes

Did you also happen to file a support request? (not saying you should - I just need to know if you did)

On 77.x not reproducing.

Thanks Max, that is very useful information. Which 77.x? (there are three betas listed at http://archive.mozilla.org/pub/thunderbird/releases/ 77.0b1, 77.0b2, 77.0b3) Did you also test the v78 betas?

Flags: needinfo?(nikolaev.makc)
Keywords: perf

not seen on 77.0b3
on 83.0b3 still lagged but less , CPU load up to 250%

i will file request today.
(In reply to Wayne Mery (:wsmwk) from comment #1)

Did you also happen to file a support request? (not saying you should - I just need to know if you did)

On 77.x not reproducing.

Thanks Max, that is very useful information. Which 77.x? (there are three betas listed at http://archive.mozilla.org/pub/thunderbird/releases/ 77.0b1, 77.0b2, 77.0b3) Did you also test the v78 betas?

Flags: needinfo?(nikolaev.makc)
See Also: → 1677272

I can confirm this bug.

Steps to reproduce:

1.) Have enough stuff in Account pane so that you have to scroll
2.) Scroll the left pane up or down

Actual results:
60-80% CPU usage. Very laggy and Jumpy scrolling.

Expected results:
Nominal CPU usage. Smooth scrolling.

I'm on Mac OS Catalina 10.15.7 (19H2) and Thunderbird 78.4.3 (64-bit)

Summary: Thunderbird 78.4.x account list / folder pane slow to scroll on Mac → Thunderbird 78.4.x account list / folder pane slow to scroll on MacOS 10.15

I'm also seeing this - the scrolling on the account / folder pane is painfully slow.

Running 78.4.3 - not observed with the previous major version.

Still present in 78.5.0 (both on macOS 10.5 and the 11.0.1 Big Sur upgrade I just installed).

You might try the build mentioned in bug 1677272 comment 55.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(ray)
Flags: needinfo?(github)
Duplicate of this bug: 1679362

Max,
Alex,
Nicolas,
Ray,

Please try from bug 1677272 a potential fix if you are able, so we can have your feedback. https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/cS4TP33hS7yHdUx2l1zlyQ/runs/0/artifacts/public/build/target.dmg is 78.5.1 plus a patch. It will display as version 78.6.0 although some places might refer to it as "Thunderbird Daily" because it is a test build.

Flags: needinfo?(nikolaev.makc)
Flags: needinfo?(alex.weirig)

still lagged
https://www.dropbox.com/s/9wunvvg6gkpjib5/Screenshot%202020-12-06%20at%2000.44.03.png?dl=0
CPU load less, but scrolling freezing/jumping like on previous versions.

(In reply to Wayne Mery (:wsmwk) from comment #8)

Max,
Alex,
Nicolas,
Ray,

Please try from bug 1677272 a potential fix if you are able, so we can have your feedback. https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/cS4TP33hS7yHdUx2l1zlyQ/runs/0/artifacts/public/build/target.dmg is 78.5.1 plus a patch. It will display as version 78.6.0 although some places might refer to it as "Thunderbird Daily" because it is a test build.

Flags: needinfo?(nikolaev.makc)

Thanks Max.

Next steps for you, Alex, Nicolas, Ray ... please get a performance profile by doing https://support.mozilla.org/en-US/kb/profiling-thunderbird-performance

Flags: needinfo?(nikolaev.makc)

Hi Wanye,

TB84.0b3 already looks much better.

Here's my profile:
https://share.firefox.dev/2IOCypR

Alex

Flags: needinfo?(alex.weirig)

(In reply to Wayne Mery (:wsmwk) from comment #10)

Thanks Max.

Next steps for you, Alex, Nicolas, Ray ... please get a performance profile by doing https://support.mozilla.org/en-US/kb/profiling-thunderbird-performance

Hi Wayne,

sorry for the delay. Here is my profile:

https://share.firefox.dev/3r446sL

I tested with 78.5.0 (64-Bit) on Mac OS Catalina 10.15.7 (19H2)

all I did is scroll up and down in the account pane. Thanks for looking into this!

Flags: needinfo?(github)

I wanted to report that it is much better in 84.0b3 (64-bit), but still quite sluggish. The best way to describe it: If you hover the mouse over the message list, and stop over a message, the message gets highlighted almost instantly. If you hover the mouse over the account pane, and stop at a certain folder, you can see the mouse marker move slowly over every folder you hovered over in between and then stop at where your current mouse position is.

For the scrolling it is the same - everything is "delayed".

Another thing to try - disable thunderbird hardware acceleration in preferences, and let us know the results.

(In reply to Wayne Mery (:wsmwk) from comment #14)

Another thing to try - disable thunderbird hardware acceleration in preferences, and let us know the results.

Hi Wayne,

well yes, this definitely had an effect: The message pane is now sluggyish (I'd say 5-10 fps) and the account pane completely unususable, literally 1 fps with deactivated HW acceleration.

But as I said, with enabled HW acceleration it is much better in 84.0b3. It's still laggy and slow, but definitely better than the current release version.

So whatever you did in 84xx - this was good, but needs more of that :-)

(In reply to alex.weirig from comment #11)

Hi Wanye,

TB84.0b3 already looks much better.

Here's my profile:
https://share.firefox.dev/2IOCypR

Alex

It would seem then that webrender (default in newer versions) produces much better results.

Interesting that Nicolas still sees laggy. But then, between the four of you we may be seeing a couple different problems.

Summary: Thunderbird 78.4.x account list / folder pane slow to scroll on MacOS 10.15 → Thunderbird 78.4.x account list / folder pane slow to scroll on MacOS 10.15 - high CPU in FrameLayerBuilder::PaintItems. Not better with HWA disabled. Better with Webrender.

(In reply to Max from comment #0)

Created attachment 9187915 [details]
Screenshot 2020-11-15 at 15.35.39.png

On Thunderbird 78.4.3 (64-bit) left pane ( mailboxes and folders ) very laggy and Jumpy scrolling. High CPU usage 70-100%

Thunderbird 78.4.3 (64-bit)
macOS Catalina 10.15.7 (19H2)
MacBook Pro (13-inch, 2020, Four Thunderbolt 3 ports)

Max

  • So this is an M1, with integrated graphics, 2560 x 1600 ?
  • And not yet updated to Big Sur? (I'm not suggesting you do - doing so may introduce new issues)
  • Can you create a performance profile?

not seen on 77.0b3

I'd guess then that one or both of these are causing an issue:

  • Bug 1647251 - Starting TB 78 on a profile with many folders gives unresponsive script error
  • Bug 1652279 - Starting TB 78 on a profile with many folders gives unresponsive script error - take 2

Aleca, does this and Nicolas' profile in comment 12 suggest the cause? (It isn't Max's profile, but seems likely they'd be similar)

Flags: needinfo?(alessandro)

Ha! I just realized I've been seeing a slight stutter on my 2yr old Macbook Pro 10.15. And webrender seems unavailable, troubleshooting page indicates "WEBRENDER: unavailable-no-hw-compositing by runtime: Hardware compositing is disabled" and "WEBRENDER_SOFTWARE: disabled by env: Overriden by qualified hardware"

Albert, are you still on an older version of OS, and see this issue?

Flags: needinfo?(albert)

Yeap, seeing it as well (freshly upgraded) TB 78.6.0; macOS 10.14.6

Flags: needinfo?(albert)
Duplicate of this bug: 1675697

Worth noting that the message list scrolls fine.

Thanks for the ping.
I can confirm this happens on my profile as well.
I'll take care of it.

Flags: needinfo?(alessandro)
Assignee: nobody → alessandro
Priority: -- → P2

aleca, here is a profile from Mac 10.15.7, TB 85.0b3 https://share.firefox.dev/3ofIKqy (so perhaps not as slow as 78)

Hi Alessandro,

I have downloaded TB 85.0b3 and installed on macOS 10.15.7 with a new profile. I setup one of my account and the scrolling is nice and smooth.
I will do some more testing with my previous profile migrated from TB 78.6.0 and see how that goes.

Thanks
Josh

Correction above,

Correction above,
I will do some more testing with my previous profile migrated from TB 68.12.1 and see how that goes.

I think this might be an issue coming from the XUL tree.
I did a simple test in Firefox by opening the bookmark sidebar, which uses the XUL tree element, and started scrolling up and down through all my bookmarks.
The CPU spiked up to 75% immediately.

On our side, this issue presents itself whenever multiple quick mouse interactions happen with any of our tree element (accounts list, folder pane, thread pane, etc).

Who can we ping from the m-c side to confirm this?

Flags: needinfo?(vseerror)

Emilio gave us a great help in troubleshooting this issue and it seems to be related to this C++ code, which calls getRowProperties during painting, only on Mac.

https://searchfox.org/mozilla-central/rev/a0ccd492719b1ad2106f6456549be62a76f45acb/layout/xul/tree/nsTreeBodyFrame.cpp#2598

Bug 1192053 should be the culprit causing this regression.

Flags: needinfo?(vseerror)
Keywords: regression
Regressions: 1192053
Regressed by: 1192053
No longer regressions: 1192053

(In reply to Alessandro Castellani (:aleca) from comment #28)

Emilio gave us a great help in troubleshooting this issue and it seems to be related to this C++ code, which calls getRowProperties during painting, only on Mac.

https://searchfox.org/mozilla-central/rev/a0ccd492719b1ad2106f6456549be62a76f45acb/layout/xul/tree/nsTreeBodyFrame.cpp#2598

Bug 1192053 should be the culprit causing this regression.

Are you sure on that bug ? it was closed 4yrs ago?

Note that I'm not really arguing against that the code mentioned in comment #28 consumes CPU, but bug 1192053 was fixed in mozilla52 so if this started in 78 the problem might be somewhere else. Perhaps the tree is repainting more often nowadays?

The code and bug was highlighted by Emilio in the Matrix chat.
We suspected it might be related since this issue happens only on macOS.

I tried to change it, and even remove it completely, but it didn't produce any variation and the problem persisted, so, probably that's not the culprit.

The CPU spike happens also in Firefox when scrolling the bookmark list, which I think is the only section which currently uses the XUL Tree element, right?

There are a few more trees, sidebar is one example.

Hello,

This bug report (1677380) has mentioned a link to bug 1677272.
Looking at 1677272 is has been reported to be fixed in 78.7.0. I have just tested on macOS 10.15.7 and the smooth scrolling is not fixed.
I would say the two issues are not related

I'm seeing this problem or something very like it on Thunderbird 78.7.1. I also see switching to a different folder by clicking on it is sometimes slow, too.

I have a Late 2014 iMac Retina with MacOS 11.1, with a 1920x1080 non-Retina screen as a second display. Moving the Thunderbird window to the second screen makes it quite snappy. Switching the main display to a non-Retina mode or setting "Open in Low Resolution" in Finder also has the same effect, the Finder setting is my workaround for now. There also seems to be a dependence on window size; the smaller the window the better the performance in either low-res or Retina modes. Doing a whole-system time profile in Instruments while scrolling the folders pane up and down shows Thunderbird has much higher CPU usage in Retina mode, but WindowServer seems not to be affected.

I can collect traces/profiles/other data if anyone wants them.

bug 1661980 is specifically about Macs and 4K displays, already links this one, and might be a duplicate.

After the last post above from (cgull), I have done some more testing.
I have two Mac's:

  1. Personal one which is a 2013 - 13' Mac Book Pro (2560 x 1600 with Intel Iris - 1536 MB) on 10.15, no external monitor and using the laptop display, I see the slow and choppy
  2. Work one which is a 2017 - 15' Mac Book Pro (2880 x 1800 with Radeon Pro 560 - 4GB) on 10.14, with two external monitors attached via USB-C to USB-C (24' (1440x2560)). When using Thunderbird 78.7.1 on the Mac display, I see the slow and choppy behavior from the folder pane. If I move the Thunderbird window to one of the external displays, the scrolling on the folder pane has improved drastically and I would say is about 90% of what it was on Thunderbird 68.12.1.

So not sure why Thunderbird 78.7.1 is much better on the external display as compared to on the Mac display.
Thought it was an interesting part of info to share, similar to (cgull) above

Thanks
Josh

I bisected with mozregression from version 68 forward (it's pretty boring, so I did it twice to be sure).

$ ~/Library/Python/3.9/bin/mozregression -n thunderbird -g 68 -p ~/Library/Thunderbird/Profiles/XXXXXXXX.default/ --profile-persistence clone-first

[bisect bisect bisect]

42:53.97 INFO: Last good revision: a888cc00988ff7b4a21dbd05178cd0d2a055b063
42:53.97 INFO: First bad revision: 72f9e9481a5f68fcfef55cfa2bed132f6de51690
42:53.97 INFO: Pushlog:
https://hg.mozilla.org/comm-central/pushloghtml?fromchange=a888cc00988ff7b4a21dbd05178cd0d2a055b063&tochange=72f9e9481a5f68fcfef55cfa2bed132f6de51690
$ 

I am not a web developer but https://hg.mozilla.org/comm-central/rev/87bdc889cbad5156c23cb04c819c1905bd7ffdcc seems most probable as the cause. @aleca, it's one of yours...

Also noted: rotating the second monitor to 1080x1920 resolution does make Thunderbird slow enough for noticeable lagginess.

Er, using Thunderbird expanded to full height on a monitor rotated to 1080x1920 resolution does make Thunderbird slow.

(In reply to Alessandro Castellani [:aleca] from comment #28)

Emilio gave us a great help in troubleshooting this issue and it seems to be related to this C++ code, which calls getRowProperties during painting, only on Mac.

https://searchfox.org/mozilla-central/rev/a0ccd492719b1ad2106f6456549be62a76f45acb/layout/xul/tree/nsTreeBodyFrame.cpp#2598

Bug 1192053 should be the culprit causing this regression.

Is it odd that, 5 years later, we'd only be noticing this now? And this bug is the only regression marked against Bug 1192053. Though we have other potential duplicates: bug 1697999, bug 1682229

Are you able to reproduce the slowness?

Flags: needinfo?(alessandro)

When I did the bisect (comment 37), good (fast) versions had an older theme with what looked like bitmap icons in the folder pane, and bad (slow) ones had the current theme with SVG icons; that's the commit I mentioned. Perhaps that call is more expensive now because of the SVG icons?

Thanks John for the info on the bisect.
This might be an issue related to the color customization of the folder icons (bug 1637668), but we have a cache system in place which prevents the constant fetching and re-adding of folder properties at every mouse interaction.
We did that in bug 1686144 and it improved a lot performance.

I'll try to find some time later this week to further investigate this.

Flags: needinfo?(alessandro)

After following numerous bug reports for this "Slow, choppy scrolling in folder pane"
I just tried TB 90.0b2 and the issue has gone away for me.
I can also confirm the issue doesn't exist on TB 85.0.b3 either for me.

Based on the number of reports of this issue and that is does and doesn't exist for different people on different versions of TB.
It really is starting to sound like there is more then one issue/bug

(I am testing on MacOS 10.15.7 on a MacBook Pro (Retina, 13-inch, Late 2013))

(In reply to Joshua from comment #42)

..
Based on the number of reports of this issue and that is does and doesn't exist for different people on different versions of TB.
It really is starting to sound like there is more then one issue/bug

Yes, there are several factors changing over the past year), making deciphering reports super complicated - ain't it great?

  • big sur vs catalina
  • retina vs non-retina
  • folder pane changes in version 78
  • webrender becoming the default graphics render on beta
  • M1

FWIW, I'm no longer seeing the scroll slowness (compared to my comment 18)

Flags: needinfo?(ray)
Flags: needinfo?(nikolaev.makc)
See Also: → 1697999

Anyone found version 91 (or newer) to be better? worse?

(In reply to Alessandro Castellani [:aleca] from comment #41)

Thanks John for the info on the bisect.
This might be an issue related to the color customization of the folder icons (bug 1637668), but we have a cache system in place which prevents the constant fetching and re-adding of folder properties at every mouse interaction.
We did that in bug 1686144 and it improved a lot performance.

I'll try to find some time later this week to further investigate this.

Any findings after comment 41?

Flags: needinfo?(alessandro)

No luck, but it might be related to bug 1697999.

Flags: needinfo?(alessandro)

Removing myself as assignee as it doesn't seem to be related to the changes I did, and I suspect the core problem comes from toolkit.
Most likely our extensive usage of the XUL tree made these issues more noticeable.

Assignee: alessandro → nobody
Target Milestone: Thunderbird 78.0 → ---
See Also: → 672835
You need to log in before you can comment on or make changes to this bug.