From b1d6eefb8aeaf4e0772cc7c57bc7a0572d15dba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 11 Feb 2014 11:21:56 +0100 Subject: [PATCH] Call UpdateActiveSymbols only once from MIPSAnalyst instead of for every recognized function. Reduces startup slowdown when using a function signature file drastically. --- Core/Debugger/SymbolMap.cpp | 5 ++++- Core/Debugger/SymbolMap.h | 3 ++- Core/MIPS/MIPSAnalyst.cpp | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Core/Debugger/SymbolMap.cpp b/Core/Debugger/SymbolMap.cpp index d918524ffe..2c04ff0f39 100644 --- a/Core/Debugger/SymbolMap.cpp +++ b/Core/Debugger/SymbolMap.cpp @@ -738,7 +738,10 @@ void SymbolMap::SetLabelName(const char* name, u32 address) { if (label != labels.end()) { strcpy(label->second.name,name); label->second.name[127] = 0; - UpdateActiveSymbols(); + + // Do we really need to call this here? Causes extreme startup slowdown + // as this gets called for every function identified by the function replacement code. + // UpdateActiveSymbols(); } } } diff --git a/Core/Debugger/SymbolMap.h b/Core/Debugger/SymbolMap.h index 71122a1bb6..c4cdaca020 100644 --- a/Core/Debugger/SymbolMap.h +++ b/Core/Debugger/SymbolMap.h @@ -108,9 +108,10 @@ public: static const u32 INVALID_ADDRESS = (u32)-1; + void UpdateActiveSymbols(); + private: void AssignFunctionIndices(); - void UpdateActiveSymbols(); const char *GetLabelName(u32 address) const; const char *GetLabelNameRel(u32 relAddress, int moduleIndex) const; diff --git a/Core/MIPS/MIPSAnalyst.cpp b/Core/MIPS/MIPSAnalyst.cpp index 42220971af..c4aa46691d 100644 --- a/Core/MIPS/MIPSAnalyst.cpp +++ b/Core/MIPS/MIPSAnalyst.cpp @@ -646,6 +646,8 @@ skip: } } } + // Used to be called in SetLabelName, let's call it only once instead. + symbolMap.UpdateActiveSymbols(); } void LoadHashMap(std::string filename) {