Bug 417850

Summary: "Application style" kcm causes high cpu usage if third-party styles are installed
Product: [Applications] systemsettings Reporter: Patrick Silva <bugseforuns>
Component: kcm_styleAssignee: Plasma Bugs List <plasma-bugs>
Severity: normal CC: filipfila.kde, kde, mail, nate, nortexoid
Priority: NOR Keywords: triaged
Version: 5.26.90   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 6
Attachments: screenshot
cpu usage before qsvgstyle to be installed
cpu usage after qsvgstyle to be installed

Description Patrick Silva 2020-02-18 23:22:05 UTC
Created attachment 126146 [details]

As we can see in the attached screenshot, "Application style" kcm uses ~30% of my cpu.
It occurs on both X11 and Wayland sessions.

Operating System: Arch Linux 
KDE Plasma Version: 5.18.1
KDE Frameworks Version: 5.67.0
Qt Version: 5.14.1
Kernel Version: 5.5.4-arch1-1
OS Type: 64-bit
Processors: 2 × Intel® Celeron® CPU G1820 @ 2.70GHz
Memory: 7,7 GiB of RAM
Comment 1 Filip Fila 2020-02-19 19:54:47 UTC
Can't reproduce, tried sidebar mode, icon view, and standalone kcm in X11.

Operating System: Manjaro Linux 
KDE Plasma Version: 5.18.1
KDE Frameworks Version: 5.67.0
Qt Version: 5.14.1
Comment 2 Nate Graham 2020-02-20 23:55:09 UTC
Also cannot reproduce.
Comment 3 Michael D 2020-04-06 06:38:27 UTC
Can reproduce depending on what themes are installed. After installing qsvgstyle from AUR the kcm causes over 100% CPU usage in top. Removing qsvgstyle and its themes brings the CPU usage back to normal.
Comment 4 Patrick Silva 2020-04-06 13:19:44 UTC
Created attachment 127322 [details]
cpu usage before qsvgstyle to be installed

qsvgstyle s not installed on my Arch Linux.
I have just installed it on Neon unstable and now such system is also affected.
Compare the attached screenshots.


Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.18.80
KDE Frameworks Version: 5.69.0
Qt Version: 5.14.1
Comment 5 Patrick Silva 2020-04-06 13:20:15 UTC
Created attachment 127323 [details]
cpu usage after qsvgstyle to be installed
Comment 6 Kai Uwe Broulik 2020-04-06 14:42:27 UTC
Can confirm with the style. It appears to be in a repaint loop. We get a UpdateRequest, schedule a repaint, render the widget, which somehow gives us another UpdateRequest and then we're in a loop.

It doesn't happen when I don't have a HBox/VBoxLayout on the widget preview but other than that I have no idea what's going on in that style.
Comment 7 Bug Janitor Service 2023-01-26 12:02:42 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2543
Comment 8 Fushan Wen 2023-01-30 17:49:44 UTC
Git commit c48eda8b2a44dfa2a8e44e81874571e375117040 by Fushan Wen.
Committed on 30/01/2023 at 17:48.
Pushed by fusionfuture into branch 'master'.

kcms/style: suppress update requests from preview widget

When mouse is not above a preview item, set the update interval to 1s.

M  +29   -1    kcms/style/previewitem.cpp
M  +4    -0    kcms/style/previewitem.h