nappgui_src icon indicating copy to clipboard operation
nappgui_src copied to clipboard

Constant ~0.20% CPU Usage

Open ponjadito23 opened this issue 9 months ago • 3 comments

Hi, I've been testing the included demo apps and I've noticed that all use a small amount of CPU constantly, even minimized. I checked on Windows and Linux, it happens on both.

The Windows Task Manager is unable to show a CPU usage this low so I include a screenshot from System Informer instead

Image

ponjadito23 avatar Mar 13 '25 03:03 ponjadito23

Hi @ponjadito23!

Good observation. Indeed, NAppGUI maintains a small amount of background processing on the main thread. This is to control animations, parallel tasks, or updates in synchronous applications. However, this aspect can be improved by eliminating this monitoring in purely asynchronous applications.

Please leave this issue open. I'll do it when the time comes.

frang75 avatar Mar 13 '25 12:03 frang75

this aspect can be improved by eliminating this monitoring in purely asynchronous applications.

  • a case against not doing so if you mean by i_OnTimerLoop is, it helps in changing the theme isn't it?

leelavg avatar Mar 19 '25 03:03 leelavg

Indeed, NAppGUI performs certain tasks in the background, one of them is to detect the change of theme in macOS. I have to study the solution well and reach a commitment to reduce the impact of CPU of monitoring without losing its functionality.

frang75 avatar Mar 19 '25 08:03 frang75