efficiency mode
can i force an app to run in efficiency mode?
thanks.
It's not currently possible, but I will make it as a feature request. I need to research how this option works in Windows and I hope I will be able to implement that in procgov. Thanks for the suggestion.
This would be a very useful feature, to give some hints to Windows CPU task scheduler about which processes are less important to prioritize. Currently doing this manually via Task Manager and it does get tiresome, especially if Firefox decides to randomly spawn a few OS threads.
Usecase being putting all background apps (Firefox, Thunderbird, Discord, qBittorrent, Twinkle Tray, Auto Dark Mode, UniGetUI, FanControl, PowerToys, BattlEye Anti Cheat Service) in Efficiency Mode, and restrict their CPU core affinity to all but the last 2 SMT threads (same CPU core) on the CCD.
This keeps all other CPU resources available for the actual applications that should get priority (e.g. Visual Studio, games). During gaming this significantly improves the frametime consistency and 0,01% lows (observed with AMD Adrenalin stats overlay).
Found this line of code in imbushuo/EnergyStar that may acomplish triggering Efficiency Mode for a given process? https://github.com/imbushuo/EnergyStar/blob/18872289ac4de7d22208f1fc5b156abaa904dff8/EnergyStar/EnergyManager.cs#L81-L86
private static void ToggleEfficiencyMode(IntPtr hProcess, bool enable)
{
Win32Api.SetProcessInformation(hProcess, Win32Api.PROCESS_INFORMATION_CLASS.ProcessPowerThrottling,
enable ? pThrottleOn : pThrottleOff, (uint)szControlBlock);
Win32Api.SetPriorityClass(hProcess, enable ? Win32Api.PriorityClass.IDLE_PRIORITY_CLASS : Win32Api.PriorityClass.NORMAL_PRIORITY_CLASS);
}
Thanks for the code snippet. I checked Task Manager and it is also using SetProcessInformation to configure the power throttling, so that's the way to do that. Unfortunately, implementing it in process governor requires some more work as I want to support the recursive mode (apply it to all child processes and not only the parent). I plan to have this change implemented in version 3.3 (so the one after the next release).