SMCAMDProcessor icon indicating copy to clipboard operation
SMCAMDProcessor copied to clipboard

AMD Power Gadget Window - Disabling updating in background

Open thomaslfessler opened this issue 4 years ago • 8 comments

In the AMD Power Gadget Window:

  • Running with a 3900x.
  • Drawing the Frequency, Temperature and Power graphs graphs consumes ~15% of system resources.
  • Disabling the graphs in code reduces CPU utilization to 0.2%.
  • When application is minimized, CPU utilization does not reduce, indicating the Frequency, Temperature and Power graphs are still drawing in the background and consuming CPU resources.
  • Options to disable graphs in the foreground, or when placed in the background would be a useful addition.

thomaslfessler avatar Jun 15 '20 18:06 thomaslfessler

You can just quit the App, the power management is done by the kext independent of the App.

aluveitie avatar Jun 15 '20 19:06 aluveitie

Indeed, why kept the windows open if you don’t want to see the graph? I believe all Cocoa applications will stop rendering when minimized to background, it could be the timer task that is running that forcing CALayer to update. I will do more profiling soon, but I’ve never saw the application use more than 5%. And I am as well using a Ryzen 3900

trulyspinach avatar Jun 16 '20 00:06 trulyspinach

I'm also seeing 15-20% CPU usage in the Activity Monitor

edit Looks like it also creates quite some load (15-20%) on the WindowServer process.

aluveitie avatar Jun 16 '20 04:06 aluveitie

I'm also seeing 15-20% CPU usage in the Activity Monitor

edit Looks like it also creates quite some load (15-20%) on the WindowServer process.

The load is directly attributed to the drawing routines. Not that the visualization of the graphs is a bad thing, it's just a bit resource intensive on macOS Catalina 15.5.5 with a 5700XT running a 4K display.

Running the distributed application, AMD Power Gadget is currently using 15.7% CPU utilization. Any time the displayed graphs displays a large variance in values, CPU utilization increases to 18%+.

drag6-16-2011 06 37

In ViewController.swift, commenting out lines 113, 115, 120 and 121, CPU utilization for the app drops to 0.1%.

drag6-16-2011 09 01

Enabling just the temperature graph, CPU utilization sits at 5.5%, about 1/3 of the recorded usage.

drag6-16-2011 11 25

thomaslfessler avatar Jun 16 '20 18:06 thomaslfessler

The information you have provided is not helpful at all. Yes of course directly disabling some functionality in source code will reduce CPU usage. Plus 15% is very much acceptable. Beware that activity monitor uses Unix style display in which that 15% is not of your whole system, but a single logical thread. Though it is always good to optimize and reduce resources usage. It would be helpful if you directly open up a pull request or provide a profiling of the current drawing program.

trulyspinach avatar Jun 17 '20 00:06 trulyspinach

I went back to version 0.6.1 and re-tested. There was virtually no CPU load by the App back then. I assume the new fluid drawing added afterwards is the source of it.

And the differences are not neglectable. The new implementation seems to results in 10-15 Watt increased power usage while idle with temperature up by about 2 degrees compared to the old implementation.

aluveitie avatar Jun 17 '20 04:06 aluveitie

@trulyspinach. Hmmm. And here I thought I clearly demonstrated chart drawing is the source of the CPU usage. Showing with drawing enabled (15-18%)- disabled(0.5%), and with one chart enabled out of 3 (5% or 33% of the load) ~ VS the overall low percentage on your machine with a 3900x.

@aluveitie - Good catch on increased power consumption and temp increase due to the drawing routine.

thomaslfessler avatar Jun 17 '20 22:06 thomaslfessler

I noticed the increased power usage too while idle as @aluveitie has mentioned.

cuongvoong avatar Jul 02 '20 09:07 cuongvoong