trulyspinach / SMCAMDProcessor

Power management, monitoring and VirtualSMC plugin for AMD processors
BSD 3-Clause "New" or "Revised" License
1.04k stars 90 forks source link

AMD Power Gadget Window - Disabling updating in background #87

Open thomaslfessler opened 4 years ago

thomaslfessler commented 4 years ago

In the AMD Power Gadget Window:

aluveitie commented 4 years ago

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

trulyspinach commented 4 years ago

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

aluveitie commented 4 years ago

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.

thomaslfessler commented 4 years ago

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
trulyspinach commented 4 years ago

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.

aluveitie commented 4 years ago

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.

thomaslfessler commented 4 years ago

@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.

cuongvoong commented 4 years ago

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