Browse Source

Add profiling to StringTable.

Daniel Buckmaster 10 years ago
parent
commit
40b871e652
1 changed files with 7 additions and 0 deletions
  1. 7 0
      Engine/source/core/stringTable.cpp

+ 7 - 0
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];