let profiler trace 'get member' calls, because I suspect they might be slow (linear string lookup)

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1244 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-12-11 16:28:17 +00:00
parent 010c8d8d0b
commit dc2028a956
3 changed files with 28 additions and 0 deletions
+13
View File
@@ -104,6 +104,19 @@ Profiler::Profiler(Timer& timer, Variable function_name)
timer.exclude_time();
}
// Enter a function
Profiler::Profiler(Timer& timer, const Char* function_name)
: timer(timer)
, parent(function) // push
{
FunctionProfileP& fpp = parent->children[(size_t)function_name];
if (!fpp) {
fpp = new_intrusive1<FunctionProfile>(function_name);
}
function = fpp.get();
timer.exclude_time();
}
// Enter a function
Profiler::Profiler(Timer& timer, void* function_object, const String& function_name)
: timer(timer)