By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.

Bug 3199

Summary: TDE Hardware Manager is VERY slow and mostly completely freezes
Product: TDE Reporter: Roman Savochenko <rom_as>
Component: tdebaseAssignee: Timothy Pearson <kb9vqf>
Status: PATCHAVAIL ---    
Severity: major CC: bugwatch, rom_as
Priority: P5    
Version: R14.0.x [Trinity]   
Hardware: Other   
OS: Linux   
Compiler Version: TDE Version String:
Application Version: Application Name:
Attachments: hwmanager-NoFreeze.patch
tdehw-NoFreeze.patch

Description Roman Savochenko 2023-02-20 10:18:32 CST
Created attachment 3048 [details]
hwmanager-NoFreeze.patch

I have got such behaviour at least on two modern enough hardware environments Intel(R) Core(TM) i7-5600U and AMD A8-6500 APU. So, once I enter to HM, that freezes mostly.

That is related seems with reading some hardware in long time and if I comment that link in the file /kcontrol/hwmanager/hwmanager.cpp, I get the slow work, but that isn't the complete freeze:
connect(hwdevices, TQT_SIGNAL(hardwareUpdated(TDEGenericDevice*)), this, TQT_SLOT(deviceChanged(TDEGenericDevice*)));
Comment 1 Roman Savochenko 2023-03-25 01:38:35 CDT
Created attachment 3052 [details]
tdehw-NoFreeze.patch

As me learned the issue deeply, this problem is in tdelibs/tdecore/tdehw, in the class TDEHardwareDevices of the files tdehardwaredevices.{h,cpp}. In the Timer invokes processModifiedCPUs() and processStatelessDevices() which are called in the main Qt GUI thread, with fixed small intervals and consume many time even on powerful hardware:
• processModifiedCPUs() up to 200ms (40%);
• processStatelessDevices() up to 1s (50%) without the notification and WHOLE Timer cycle with notification tdebase/kcontrol/hwmanager.

That is a BAD practice and if you call such functions in the main Qt GUI thread, you must whether to limit the functions time, doing only some part of all works, what I have added to processStatelessDevices(), or to stretch the Timer interval dynamically, what I have added to processModifiedCPUs(). And the first way is a preferable one and must be implemented for processModifiedCPUs() also.