Skip to content

Commit

Permalink
set to REPL to run in efficiency mode under Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
objeck committed Nov 20, 2023
1 parent 91ddf36 commit f69842a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/repl/repl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,15 @@ void SetEnv()
std::wcerr << "Unable to initialize I/O subsystem" << std::endl;
exit(1);
}

// set to efficiency mode
SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS);
PROCESS_POWER_THROTTLING_STATE PowerThrottling = { 0 };
PowerThrottling.Version = PROCESS_POWER_THROTTLING_CURRENT_VERSION;
PowerThrottling.ControlMask = PROCESS_POWER_THROTTLING_EXECUTION_SPEED;
PowerThrottling.StateMask = PROCESS_POWER_THROTTLING_EXECUTION_SPEED;
SetProcessInformation(GetCurrentProcess(), ProcessPowerThrottling, &PowerThrottling, sizeof(PowerThrottling));

#endif
#else
#if defined(_X64)
Expand Down

0 comments on commit f69842a

Please sign in to comment.