Open Bug 1794110 Opened 2 years ago Updated 1 month ago

High CPU usage in nsViewManager::ProcessPendingUpdatesPaint / webrender during mail server connection

Categories

(MailNews Core :: Networking, defect)

Thunderbird 102
x86_64
Linux
defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: bd_bugs.zikh5, Unassigned)

References

(Depends on 1 open bug)

Details

(Keywords: perf, Whiteboard: [has performance profile])

Steps to reproduce:

Configure a SOCKS proxy.
Connect to a POP3 or IMAP mail server through the proxy. Observe the CPU usage (you can wait with entering the password for a few seconds).

Configure a real or dummy SOCKS proxy (like 127.0.0.1:9999, you can choose whichever port you like) and leave the proxy setting on "Manual". Add your POP3/IMAP server to proxy exceptions.
Connect to your POP3 or IMAP mail server when the proxy is still configured to "Manual", even when your server is on the exception list. Observe the CPU usage (you can wait with entering the password for a few seconds).

Actual results:

CPU usage is about 70% (on one core) during connecting, authenticating (even when the connection is idle because the user is entering the password at the moment) and fetching messages.

Expected results:

The CPU should be almost idle when the user is entering the password.
The CPU should be idle when nothing is happening on the network (e.g. waiting for connection, etc.).
It should just be some events that trigger CPU activity, and not having the process run at all times.

Changing the proxy setting to "No proxy" does NOT cause such high CPU usage. So, even if a server is on the proxy exceptions' list (so the connection is direct), the connection still seems to suffer from excessive CPU usage from the sole fact that the proxy setting is set to "Manual".
The defect was also present in the 91.x series.

OS: Unspecified → Linux
Hardware: Unspecified → x86_64
Component: Untriaged → Networking
Product: Thunderbird → MailNews Core
Flags: needinfo?(bd_bugs.zikh5)

Hi.
Two problems with this:

  1. the instructions seem to be out-of-date. In point 2.3, I don't have the "Stop recording" button. I have "Start recording" and, once clicked, just "Capture recording" and "Cancel". Well, at least in the locale I downloaded Thunderbird with, because the Developer tools are still localized even though I switched Thunderbird to English.
  2. I click "Start recording", do my actions, and then "Capture recording". A new window opens, with the URL https://profiler.firefox.com/from-browser and a red error message "Uh oh, some error happened in profiler.firefox.com.". Details:
SecurityError: The operation is insecure.

KT@https://profiler.firefox.com/main.2f37c76ee5ee3a6fb906.bundle.js:147:141796
YT@https://profiler.firefox.com/main.2f37c76ee5ee3a6fb906.bundle.js:147:142589
c@https://profiler.firefox.com/main.2f37c76ee5ee3a6fb906.bundle.js:2:17259
Te@https://profiler.firefox.com/main.2f37c76ee5ee3a6fb906.bundle.js:2:15601
eg@https://profiler.firefox.com/main.2f37c76ee5ee3a6fb906.bundle.js:121:15249
QT@https://profiler.firefox.com/main.2f37c76ee5ee3a6fb906.bundle.js:147:143667
Flags: needinfo?(bd_bugs.zikh5)

(In reply to bogdro from comment #4)

...
2. I click "Start recording", do my actions, and then "Capture recording". A new window opens, with the URL https://profiler.firefox.com/from-browser and a red error message "Uh oh, some error happened in profiler.firefox.com.". Details:

SecurityError: The operation is insecure.

Can you try again?

Thanks for the correction to the instructions.

Flags: needinfo?(bd_bugs.zikh5)

Yes! This time it worked.
Shared link: https://share.firefox.dev/3w76ZAw
From my inexperienced point of view:

  • it looks like it's graphics that is eating the CPU (and not the network as one would expect),
  • if you expand the first tree (always follow the first child node), it looks like ViewportFrame::BuildDisplayList is calling itself (the same addresses before and after).

Maybe this helps (or, maybe not).

Flags: needinfo?(bd_bugs.zikh5)

Thanks for the update.

Summary: High CPU usage during mail server connection when proxy set (even when not used) → High CPU usage in nsViewManager::ProcessPendingUpdatesPaint / webrender during mail server connection
Whiteboard: [has performance profile]
Depends on: 1891416
You need to log in before you can comment on or make changes to this bug.