Bug 504995

Summary: Processes tab: High CPU usage
Product: [Applications] plasma-systemmonitor Reporter: Alexander Potashev <aspotashev>
Component: generalAssignee: KSysGuard Developers <ksysguard-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: ahiemstra, kde, nate, plasma-bugs-null
Priority: NOR    
Version First Reported In: 6.3.4   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Alexander Potashev 2025-05-29 23:30:47 UTC
SUMMARY
Processes tab: High CPU usage (~30%)

STEPS TO REPRODUCE
1. Open Processes  tab
2. 
3. 

OBSERVED RESULT
plasma-systemmonitor CPU usage is ~30%. For comparison, htop uses ~4%.

EXPECTED RESULT
Should be more efficient.

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 41
KDE Plasma Version: 6.3.4
KDE Frameworks Version: 6.14.0
Qt Version: 6.8.2
Kernel Version: 6.13.11-200.fc41.x86_64 (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-6700HQ CPU @ 2.60GHz
Memory: 15.4 ГиБ of RAM
Graphics Processor 1: Intel® HD Graphics 530
Graphics Processor 2: NVIDIA GeForce GTX 960M

ADDITIONAL INFORMATION
Comment 1 Bug Janitor Service 2025-05-30 12:17:51 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/libksysguard/-/merge_requests/422
Comment 2 David Edmundson 2025-05-30 12:22:22 UTC
In general bug reports aren't good for performance tickets because things can /always/ be better, so it just lingers forever and ever.

But I did some profiling and fixed one silly thing that gets rid of a huge chunk. It's still far from good, but definitely better.


I'll also open two tickets on some other findings I had.
Comment 3 Alexander Potashev 2025-05-30 18:39:26 UTC
Great, thank you! :-)
Comment 4 David Edmundson 2025-06-02 09:01:58 UTC
Git commit 88e9b4d7eeb12da5474d52f039e9f74f50b50e8a by David Edmundson.
Committed on 02/06/2025 at 08:59.
Pushed by davidedmundson into branch 'master'.

Reduce false update notifications on UIDs

The process object keeps track of changes on each update comparing
against the last value.

If a process is owned by uid 1000, calling setUid(0) setUid(1000) in the
same update will trigger the flag as having changed. This causes lots of
needless updates from re-filtering user processes to re-evaluating
javascript.

M  +32   -5    processcore/processes_linux_p.cpp

https://invent.kde.org/plasma/libksysguard/-/commit/88e9b4d7eeb12da5474d52f039e9f74f50b50e8a
Comment 5 Bug Janitor Service 2025-06-03 07:52:58 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/libksysguard/-/merge_requests/424
Comment 6 Arjen Hiemstra 2025-06-03 07:54:53 UTC
Git commit 4149d7b77d45b7508f49721f3c2f5cd290f9ff10 by Arjen Hiemstra.
Committed on 03/06/2025 at 07:52.
Pushed by ahiemstra into branch 'Plasma/6.4'.

Reduce false update notifications on UIDs

The process object keeps track of changes on each update comparing
against the last value.

If a process is owned by uid 1000, calling setUid(0) setUid(1000) in the
same update will trigger the flag as having changed. This causes lots of
needless updates from re-filtering user processes to re-evaluating
javascript.


(cherry picked from commit 88e9b4d7eeb12da5474d52f039e9f74f50b50e8a)

Co-authored-by: David Edmundson <kde@davidedmundson.co.uk>

M  +32   -5    processcore/processes_linux_p.cpp

https://invent.kde.org/plasma/libksysguard/-/commit/4149d7b77d45b7508f49721f3c2f5cd290f9ff10