Split script profiler into a separate file

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1201 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-09-03 20:55:48 +00:00
parent d0e83dd277
commit f405b82ce2
8 changed files with 265 additions and 120 deletions
+1 -20
View File
@@ -13,8 +13,6 @@
class Dependency;
#define USE_SCRIPT_PROFILING 1 // TODO: Disable before release!
// ----------------------------------------------------------------------------- : VectorIntMap
/// A map like data structure that stores the elements in a vector.
@@ -127,9 +125,7 @@ class Context {
/// Get a variable name givin its value, returns (Variable)-1 if not found (slow!)
Variable lookupVariableValue(const ScriptValueP& value);
#if USE_SCRIPT_PROFILING
friend class ScriptCompose;
#endif
friend class ScriptCompose;
};
/// A class that creates a local scope
@@ -142,20 +138,5 @@ class LocalScope {
size_t scope;
};
// ----------------------------------------------------------------------------- : Profiler
#if USE_SCRIPT_PROFILING
struct FunctionProfileItem {
FunctionProfileItem() {}
FunctionProfileItem(const String& name, double time, int calls) : name(name), time(time), calls(calls) {}
inline bool operator < (const FunctionProfileItem& that) { return time < that.time; }
String name;
double time;
int calls;
};
void get_profile(vector<FunctionProfileItem>& out);
#endif
// ----------------------------------------------------------------------------- : EOF
#endif