Avoid calling thread->getName() in release builds.

Profile shows this will save a couple percentage points.
This commit is contained in:
Unknown W. Brackets 2012-12-24 15:16:04 -08:00
parent 138b3a0823
commit 0eb13142aa

View File

@ -2172,7 +2172,10 @@ void __KernelSwitchContext(Thread *target, const char *reason)
__KernelSaveContext(&cur->context);
oldPC = currentMIPS->pc;
oldUID = cur->GetUID();
oldName = cur->GetName();
// Profile on Windows shows this takes time, skip it.
if (DEBUG_LEVEL <= MAX_LOGLEVEL)
oldName = cur->GetName();
}
currentThread = target->GetUID();
__KernelLoadContext(&target->context);