Project

General

Profile

Bug #1831

High cpu usage (energy impact) on M1 macOS (progress bar animation never stops)

Added by phire over 2 years ago. Updated 18 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Quassel GUI (Qt)
Target version:
-
Start date:
08/19/2022
Due date:
% Done:

0%

Estimated time:
Version:
0.14.0
OS:
Mac OS X

Description

The Quassel client shows up very high in the MacOS activity viewer as using a lot of energy. Checking the CPU usage, it seems to be using 7-14% of an E-core all the time.

The actual wasted energy usage isn't that high, only about half a watt. But still.... PowerMetrics reported Quassel was getting about 61 wakeups per second, which indicates something is triggering redraws.

I tried a few things to try and fix this. I assumed it was related to Rosetta, and made a native Apple Silicon build, which reduced the cpu usage by about half, but still way too high. I hacked together a Qt6 build, because I thought it might have been an issue in Qt5. Didn't fix it.

I tried profiling, but that seemed to indicate the redraws were coming from within cocoa itself. Eventually I got desperate and started commenting out various bits of code and eventually tracked it to the backlog loading progress bar in the status bar. If you disable the status bar in the view menu (and restart Quassel), the issue goes away. The progress bar is briefly shown during connection, and for some reason it causes cocoa to trigger a redraw at 60fps for the rest of time. Even after the progress bar is hidden again.

Some googling brings up this old bug: https://bugreports.qt.io/browse/QTBUG-20880 that seems to be related. But it's meant to be fixed, and the current stylesheet doesn't even have an animation for the progress bar.

I also tried a few code workarounds: Resetting the progress bar, setting the max to 0, setting the progress to 100%, removing the progress bar from the layout and deleting it... nothing seemed to return the cpu usage to normal. The only "fix" was to never show the progress bar in the first place.

Workaround:

Disable the Status bar in the view menu and restart Quassel.

History

#2 Updated by stoerp 11 months ago

I can confirm that the issue still persists and that the workaround helps. Thanks!

Quassel v0.14.0 / Qt 5.15.2

Also available in: Atom PDF