diff options
author | Dave Parks <davep@lindenlab.com> | 2022-11-30 13:25:00 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-11-30 13:25:00 -0600 |
commit | 87bb72a47a1fc64b98e498120e332de76e6a9211 (patch) | |
tree | 1e48ca7915525368bf3eda06447ab4edcaf0be60 /indra/llwindow | |
parent | adbd264d35f5fabe28249839da6c12e5dac4127f (diff) |
SL-18154 WIP -- CPU sampling (AMD uProf) profile guided optimizations to reduce CPU usage of background threads.
Diffstat (limited to 'indra/llwindow')
-rw-r--r-- | indra/llwindow/llwindowwin32.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index c0d3424141..be5af8240f 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -467,7 +467,6 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, // process deprioritization during profiles // force high thread priority HANDLE hProcess = GetCurrentProcess(); - HANDLE hThread = GetCurrentThread(); if (hProcess) { @@ -484,6 +483,20 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, } } } +#endif + +#if 0 // this is also probably a bad idea, but keep it in your back pocket for getting main thread off of background thread cores (see also LLThread::threadRun) + HANDLE hThread = GetCurrentThread(); + + SYSTEM_INFO sysInfo; + + GetSystemInfo(&sysInfo); + U32 core_count = sysInfo.dwNumberOfProcessors; + + if (max_cores != 0) + { + core_count = llmin(core_count, max_cores); + } if (hThread) { @@ -499,6 +512,9 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, { LL_INFOS() << "Failed to set thread priority: " << std::hex << GetLastError() << LL_ENDL; } + + // tell main thread to prefer core 0 + SetThreadIdealProcessor(hThread, 0); } } #endif |