From 7e814decc73b5d101c46788459ef7bc51d007208 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 30 Jan 2022 08:23:14 -0800 Subject: [PATCH] Headless: Improve total test time on Windows. This improves it by almost 40%. --- Windows/main.cpp | 3 ++- headless/Headless.cpp | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Windows/main.cpp b/Windows/main.cpp index 1885c72cf6..26365e8c42 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -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); diff --git a/headless/Headless.cpp b/headless/Headless.cpp index 941150d15d..22beaa129a 100644 --- a/headless/Headless.cpp +++ b/headless/Headless.cpp @@ -14,6 +14,10 @@ #include "Common/System/NativeApp.h" #include "Common/System/System.h" +#include "Common/CommonWindows.h" +#if PPSSPP_PLATFORM(WINDOWS) +#include +#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;