From 0eb13142aa6ff359e1042eb6f7679cad6745ce42 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 24 Dec 2012 15:16:04 -0800 Subject: [PATCH] Avoid calling thread->getName() in release builds. Profile shows this will save a couple percentage points. --- Core/HLE/sceKernelThread.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index 7a9aee2b43..803bb245a5 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -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);