From 428d0cec908be7f391286d563433647a7d5d1232 Mon Sep 17 00:00:00 2001 From: Luke Usher Date: Fri, 5 Oct 2018 22:28:47 +0100 Subject: [PATCH] Set process proiority to above_normal: Significant performance boost! --- src/CxbxKrnl/CxbxKrnl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/CxbxKrnl/CxbxKrnl.cpp b/src/CxbxKrnl/CxbxKrnl.cpp index b1139e7e3..650cde45a 100644 --- a/src/CxbxKrnl/CxbxKrnl.cpp +++ b/src/CxbxKrnl/CxbxKrnl.cpp @@ -1515,6 +1515,12 @@ __declspec(noreturn) void CxbxKrnlInit } } + // Set process priority to higher than default + // Gives a significant performance boost, even without the 'all cores' hack + // We could use HIGH or even REALTIME priority for a higher boost, but that would decrease host OS responsiveness + // TODO: Make this user configurable? + SetPriorityClass(GetCurrentProcess(), ABOVE_NORMAL_PRIORITY_CLASS); + // initialize graphics DBG_PRINTF_EX(LOG_PREFIX_INIT, "Initializing render window.\n"); XTL::CxbxInitWindow(true);