Bug 419187 - Kwin High CPU usage when notification arrives
Summary: Kwin High CPU usage when notification arrives
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kwin
Classification: Plasma
Component: platform-x11-standalone (show other bugs)
Version: 5.18.3
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: efficiency
Depends on:
Blocks:
 
Reported: 2020-03-24 17:30 UTC by whew-inc
Modified: 2023-09-06 10:38 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
vlad.zahorodnii: NVIDIA+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description whew-inc 2020-03-24 17:30:22 UTC
SUMMARY
When a notification pops up, kwin_x11 uses up to 90% of the CPU for a few seconds.

STEPS TO REPRODUCE
1. Enter command "notify-send anything" in Konsole

OBSERVED RESULT
Notification pops up. Whole system lags for a second or two, and kwin spikes to around 90% CPU usage in that time.

EXPECTED RESULT
A notification without the lag.

SOFTWARE/OS VERSIONS
Operating System: KDE neon 5.18
KDE Plasma Version: 5.18.3
KDE Frameworks Version: 5.68.0
Qt Version: 5.14.1
Kernel Version: 5.3.0-42-generic
OS Type: 64-bit
Processors: 16 × AMD Ryzen 7 2700X Eight-Core Processor
Memory: 15.6 GiB of RAM
Nvidia Proprietary driver version 435.21
GTX 1070

ADDITIONAL INFORMATION
Especially annoying when playing a game, because in-game the fps drops down to like 5-10fps during the high cpu usage.
Telegram and Discord notifications are no exception.

Switching to XRender backend seems to nearly eliminate the lag, but it's still noticeable for less than a second, and there seems to be no usage spike.
OpenGL 2.0 makes kwin_x11 spike to around 70%
OpenGL 3.1 makes kwin_x11 spike to around 90%
Comment 1 Vlad Zahorodnii 2020-03-26 09:30:41 UTC
Can't reproduce this bug with AMD.
Comment 2 whew-inc 2020-03-26 16:36:26 UTC
Disabling "Force (Full) Composition Pipeline" in NVIDIA settings and exporting KWIN_TRIPLE_BUFFER=1 seems to lower the usage spike significantly.

OpenGL 3.1: ~10%
OpenGL 2.0: ~10%
XRender: <2%

(These are measured in KSysGuard, Process Table, "CPU %" without dividing by number of CPUs)

Unfortunately the lag is still there with OpenGL, although less severe. Using XRender makes it nearly unnoticeable.
Comment 3 whew-inc 2020-04-18 19:01:05 UTC
Okay the lag is still there, I guess it was a placebo. I enabled do not disturb forever, now it doesn't lag but I can't see incoming notifications :/
Comment 4 David Edmundson 2023-09-06 10:38:47 UTC
This bug was reported against an outdated version of KWin. We have made many changes since the. 
If the issue persists in newer versions can you reopen the bug report updating the version number.