mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
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:
+1
-20
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user