@ninedan reported that calling GetTotalThreadPoolCompletionCount is costing ~0.62% of all CPU usage in a large server scenario. It looks like we can easily move the following lines inside the check to for the thread adjustment interval, only paying this cost when we might use the answer.
@kouvel what do you think?
|
DWORD currentTicks = GetTickCount(); |
|
LONG totalNumCompletions = (LONG)Thread::GetTotalWorkerThreadPoolCompletionCount(); |
|
LONG numCompletions = totalNumCompletions - VolatileLoad(&PriorCompletedWorkRequests); |
@ninedan reported that calling GetTotalThreadPoolCompletionCount is costing ~0.62% of all CPU usage in a large server scenario. It looks like we can easily move the following lines inside the check to for the thread adjustment interval, only paying this cost when we might use the answer.
@kouvel what do you think?
runtime/src/coreclr/src/vm/win32threadpool.cpp
Lines 922 to 924 in 2cc926e