From 40b871e6528c212279a926df249b302bd8d623df Mon Sep 17 00:00:00 2001 From: Daniel Buckmaster Date: Mon, 29 Dec 2014 16:44:16 +1100 Subject: [PATCH] Add profiling to StringTable. --- Engine/source/core/stringTable.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Engine/source/core/stringTable.cpp b/Engine/source/core/stringTable.cpp index 2340fd5af..9a71603ae 100644 --- a/Engine/source/core/stringTable.cpp +++ b/Engine/source/core/stringTable.cpp @@ -22,6 +22,7 @@ #include "core/strings/stringFunctions.h" #include "core/stringTable.h" +#include "platform/profiler.h" _StringTable *_gStringTable = NULL; const U32 _StringTable::csm_stInitSize = 29; @@ -121,6 +122,8 @@ void _StringTable::destroy() //-------------------------------------- StringTableEntry _StringTable::insert(const char* _val, const bool caseSens) { + PROFILE_SCOPE(StringTableInsert); + // Added 3/29/2007 -- If this is undesirable behavior, let me know -patw const char *val = _val; if( val == NULL ) @@ -165,6 +168,8 @@ StringTableEntry _StringTable::insertn(const char* src, S32 len, const bool cas //-------------------------------------- StringTableEntry _StringTable::lookup(const char* val, const bool caseSens) { + PROFILE_SCOPE(StringTableLookup); + Node **walk, *temp; U32 key = hashString(val); walk = &buckets[key % numBuckets]; @@ -181,6 +186,8 @@ StringTableEntry _StringTable::lookup(const char* val, const bool caseSens) //-------------------------------------- StringTableEntry _StringTable::lookupn(const char* val, S32 len, const bool caseSens) { + PROFILE_SCOPE(StringTableLookupN); + Node **walk, *temp; U32 key = hashStringn(val, len); walk = &buckets[key % numBuckets];