Maximize the output of your CPU (Keep your CPU in full power mode)

Recently I am working on UI decoding optimization. I found this program, Full Throttle Override, is very useful, and it can fully release the power of your CPU.

To balance of power consumption and performance, almost all x86 CPUs support either Cool’n’Quiet or SpeedStep or PowerNow! technology, which can dynamically adjust the CPU frequency based on the loading.

I found it’s pretty easy to implement Full Throttle Override and here is the core C++ code

		
void FullThrottle()
{
    OSVERSIONINFO osvi;
    memset(&osvi, 0, sizeof(OSVERSIONINFO));
    osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
    GetVersionEx(&osvi);
    // For Vista and above
    if (osvi.dwMajorVersion >= 6)
    {
	GUID *scheme;
	PowerGetActiveScheme(NULL, &scheme);
	PowerWriteACValueIndex(NULL
            , scheme
            , &GUID_PROCESSOR_SETTINGS_SUBGROUP
            , &GUID_PROCESSOR_THROTTLE_MINIMUM
            , 100);
	PowerSetActiveScheme(NULL, scheme);
    }
    else
    {
	MessageBox(NULL, L"Not supported by your OS!",L"",0);
    }
}