Bug 508273

Summary: CPU usage high even when minimized
Product: [Applications] Qrca Reporter: tomashnyk
Component: generalAssignee: Jonah Brüchert <jbb>
Status: REPORTED ---    
Severity: normal CC: nicolas.fella
Priority: NOR    
Version First Reported In: 25.04.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description tomashnyk 2025-08-15 09:14:33 UTC
SUMMARY


STEPS TO REPRODUCE
1. Run QRca and minimize it
2. Run top from command line

OBSERVED RESULT
CPU usage is 50 % of one thread of one core, still enough to send fans of my computer into full spin (which they do not do when running KDE on its own)

EXPECTED RESULT
CPU usage is minimal when the app is not being used. And even when it is used, does it need so much?

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 42
KDE Plasma Version: 6.4.4
KDE Frameworks Version: 6.17.0
Qt Version: 6.9.1
ernel Version: 6.15.9-201.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × Intel® Core™ i9-9880H CPU @ 2.30GHz
Memory: 64 GiB of RAM (62,5 GiB usable)
Graphics Processor 1: Intel® UHD Graphics 630
Graphics Processor 2: NVIDIA GeForce GTX 1650 with Max-Q Design
Manufacturer: LENOVO
Product Name: 20QVS0FP00
System Version: ThinkPad X1 Extreme 2ndK
Comment 1 Jonah Brüchert 2025-09-08 08:40:29 UTC
The reason for the heigh CPU usage is that QR-Code scanning requires doing some image processing on every few frames that come from the camera.
To reduce it, we could try to detect codes less often, but then scanning becomes slower.

On my hardware it is not a noticeable problem though, and it is much weaker. Do you have a very high resolution camera by any chance?

We currently already disable scanning in the background on systems that only display one app at the time (e.g phones), but of course it would be possible to add another case for a minimized window. Patches welcome.
Comment 2 Jonah Brüchert 2025-09-08 08:44:28 UTC
(it uses < 3% of the CPU with my 1080p webcam, specs below for comparison)

Operating System: Fedora Linux 42
KDE Plasma Version: 6.4.4
KDE Frameworks Version: 6.17.0
Qt Version: 6.9.1
Kernel Version: 6.16.3-200.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 5500U with Radeon Graphics
Memory: 40 GiB of RAM (38.0 GiB usable)
Graphics Processor: AMD Radeon Graphics
Manufacturer: LENOVO
Product Name: 20YDS00G00
System Version: ThinkPad E14 Gen 3
Comment 3 tomashnyk 2025-09-08 09:17:25 UTC
My camera is 720p only. The 50 % usage is per core - I have 16 cores so it is bout 3 % of the total too.

It is not a huge issue performance-wise but even on a laptop it could burn battery quite a bit if forgotten somewhere (plus the annoyance in turning on the fan). Thinking about it now, it should disable scanning not only when minimized but probably also when not in focus in general in the background.