Headless: Improve total test time on Windows.

This improves it by almost 40%.
This commit is contained in:
Unknown W. Brackets 2022-01-30 08:23:14 -08:00
parent e062c31a82
commit 7e814decc7
2 changed files with 13 additions and 1 deletions

View File

@ -685,7 +685,8 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
LogManager::GetInstance()->SetAllLogLevels(LogTypes::LDEBUG);
}
timeBeginPeriod(1); // TODO: Evaluate if this makes sense to keep.
// This still seems to improve performance noticeably.
timeBeginPeriod(1);
ContextMenuInit(_hInstance);
MainWindow::Init(_hInstance);

View File

@ -14,6 +14,10 @@
#include "Common/System/NativeApp.h"
#include "Common/System/System.h"
#include "Common/CommonWindows.h"
#if PPSSPP_PLATFORM(WINDOWS)
#include <timeapi.h>
#endif
#include "Common/CPUDetect.h"
#include "Common/File/VFS/VFS.h"
#include "Common/File/VFS/AssetReader.h"
@ -240,6 +244,9 @@ bool RunAutoTest(HeadlessHost *headlessHost, CoreParameter &coreParameter, bool
int main(int argc, const char* argv[])
{
PROFILE_INIT();
#if PPSSPP_PLATFORM(WINDOWS)
timeBeginPeriod(1);
#endif
#if defined(_DEBUG) && defined(_MSC_VER)
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
@ -509,6 +516,10 @@ int main(int argc, const char* argv[])
LogManager::Shutdown();
delete printfLogger;
#if PPSSPP_PLATFORM(WINDOWS)
timeEndPeriod(1);
#endif
if (!failedTests.empty() && !teamCityMode)
return 1;
return 0;