Windows 11 'Efficiency Mode'
Posted: Sat Jul 12, 2025 3:00 am
Hi all,
Just a quick test here, but seems to work for placing an application into what the Task Manager calls 'Efficiency mode' -- you can right-click a task, choose 'Efficiency mode' and it goes into a special low-resource usage state.
I wanted this as it seems to make a huge difference to MEGASync on startup, where it absolutely thrashes the CPU, but (of course) there's no way to set it permanently... hopefully this will allow me to run a little program on startup, wait for MEGA to appear, set it to Efficency mode and be done.
(Also... use Copilot or other AI for C/C++ to PB problem-solving!)
* UPDATED *
Now includes option to enable or disable. Note it assumes default priority class when turning off, not whatever the program was using -- might adapt later.
You can see the result in Task Manager, where the Status 'leaf' appears and it greys-out the details...

UPDATED to include option to disable it.
Just a quick test here, but seems to work for placing an application into what the Task Manager calls 'Efficiency mode' -- you can right-click a task, choose 'Efficiency mode' and it goes into a special low-resource usage state.
I wanted this as it seems to make a huge difference to MEGASync on startup, where it absolutely thrashes the CPU, but (of course) there's no way to set it permanently... hopefully this will allow me to run a little program on startup, wait for MEGA to appear, set it to Efficency mode and be done.
(Also... use Copilot or other AI for C/C++ to PB problem-solving!)
* UPDATED *
Now includes option to enable or disable. Note it assumes default priority class when turning off, not whatever the program was using -- might adapt later.
Code: Select all
; Sets 'Efficiency Mode' in Windows 11...
; Based on https://stackoverflow.com/questions/75049477/effects-of-programmatically-enabling-efficiency-mode-for-services-in-windows-1
; Thanks, Copilot!
Structure PROCESS_POWER_THROTTLING_STATE
Version.l ; ULONG
ControlMask.l ; ULONG
StateMask.l ; ULONG
EndStructure
; Thanks, infratec!
Import ""
SetProcessInformation.l (hProcess.l, ProcessInformationClass.l, *ProcessInformation, ProcessInformationSize.l)
GetProcessInformation.l (hProcess.l, ProcessInformationClass.l, *ProcessInformation, ProcessInformationSize.l)
EndImport
#PROCESS_POWER_THROTTLING_EXECUTION_SPEED = 1
#PROCESS_POWER_THROTTLING_CURRENT_VERSION = 1
Enumeration PROCESS_INFORMATION_CLASS
#ProcessMemoryPriority
#ProcessMemoryExhaustionInfo
#ProcessAppMemoryInfo
#ProcessInPrivateInfo
#ProcessPowerThrottling
#ProcessReservedValue1
#ProcessTelemetryCoverageInfo
#ProcessProtectionLevelInfo
#ProcessLeapSecondInfo
#ProcessMachineTypeInfo
#ProcessOverrideSubsequentPrefetchParameter
#ProcessMaxOverridePrefetchParameter
#ProcessInformationClassMax
EndEnumeration
Structure EfficiencyMode
class.i
procinfo.i
EndStructure
; WIP!
; Procedure GetEfficiencyMode (process_id.i)
;
; Define ppts.PROCESS_POWER_THROTTLING_STATE
;
; ppts\Version = #PROCESS_POWER_THROTTLING_CURRENT_VERSION
; ppts\ControlMask = #PROCESS_POWER_THROTTLING_EXECUTION_SPEED
; ppts\StateMask = #PROCESS_POWER_THROTTLING_EXECUTION_SPEED
;
; process_handle.i = OpenProcess_ (#PROCESS_QUERY_INFORMATION, #False, process_id)
;
; If process_handle
;
; class.i = GetPriorityClass_ (process_handle)
;
; GetProcessInformation (process_handle, #ProcessPowerThrottling, ppts, SizeOf (ppts))
;
; Debug ppts\Version
; Debug ppts\ControlMask
; Debug ppts\StateMask
;
; EndIf
;
; EndProcedure
; Enable = #True for on, #False for off...
Procedure SetEfficiencyMode (process_id.i, enable.i)
Define ppts.PROCESS_POWER_THROTTLING_STATE
process_handle.i = OpenProcess_ (#PROCESS_SET_INFORMATION | #PROCESS_QUERY_INFORMATION, #False, process_id)
If process_handle
GetProcessInformation (process_handle, #ProcessPowerThrottling, ppts, SizeOf (ppts))
If enable
ppts\Version = #PROCESS_POWER_THROTTLING_CURRENT_VERSION
ppts\ControlMask = #PROCESS_POWER_THROTTLING_EXECUTION_SPEED
ppts\StateMask = #PROCESS_POWER_THROTTLING_EXECUTION_SPEED
SetPriorityClass_ (process_handle, #IDLE_PRIORITY_CLASS)
SetProcessInformation (process_handle, #ProcessPowerThrottling, ppts, SizeOf (ppts))
Else
; https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-setprocessinformation
; See: "The following example shows how to call SetProcessInformation with ProcessPowerThrottling to control the Quality of Service of a process."
ppts\Version = #PROCESS_POWER_THROTTLING_CURRENT_VERSION
ppts\ControlMask = #PROCESS_POWER_THROTTLING_EXECUTION_SPEED
ppts\StateMask = 0
SetPriorityClass_ (process_handle, #NORMAL_PRIORITY_CLASS) ; Ideally allow storage
SetProcessInformation (process_handle, #ProcessPowerThrottling, ppts, SizeOf (ppts))
EndIf
EndIf
EndProcedure
; D E M O . . .
Global Window_0
Procedure OpenWindow_0(x = 0, y = 0, width = 400, height = 267)
Window_0 = OpenWindow(#PB_Any, x, y, width, height, "Efficiency Mode - see Task Manager!", #PB_Window_SystemMenu)
EndProcedure
Procedure Window_0_Events(event)
Select event
Case #PB_Event_CloseWindow
ProcedureReturn #False
Case #PB_Event_Menu
Select EventMenu()
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
EndSelect
ProcedureReturn #True
EndProcedure
OpenWindow_0 ()
;process_id.l = 6952 ; Current MEGASync!
process_id.l = GetCurrentProcessId_ () ; Or insert a PID from Task Manager
; GO!
SetEfficiencyMode (process_id, #True)
Repeat
If Window_0_Events (WaitWindowEvent ()) = #False
; Turn it back off!
SetEfficiencyMode (process_id, #False)
MessageRequester ("Efficiency mode!", "Turned off -- see in Task Manager before closing.")
End
EndIf
ForEver

UPDATED to include option to disable it.