Torquescript profiling ?
by Orion Elenzil · in Torque Game Engine · 11/20/2007 (4:09 pm) · 1 replies
Does anyone know if there's a framework for profiling time spent in script functions ?
i'm thinking something you would use like this:
and then have a way to dump out the total time spent inside mySuspectFunction().
.. actually i'm thinking of something which would even tally up the time spent inside each Call Stack for each function. ie, if you discover that a function like this is taking up oodles of total time:
it doesn't do you a whole lot of good w/o knowing where it's being called from.
anyhow.
exists ?
maybe it's part of torsion ?
i'm thinking something you would use like this:
function mySuspectFunction()
{
scriptProfiler_Enter();
// la la la
for (%n = 1; %n < 10000000000; %n++)
for (%m = 1; %m < 10000000; %m++)
expensiveCall();
scriptProfiler_Leave();
}and then have a way to dump out the total time spent inside mySuspectFunction().
.. actually i'm thinking of something which would even tally up the time spent inside each Call Stack for each function. ie, if you discover that a function like this is taking up oodles of total time:
function mySimpleFunctionThatICallAllOverThePlace()
{
// do something simple
}it doesn't do you a whole lot of good w/o knowing where it's being called from.
anyhow.
exists ?
maybe it's part of torsion ?
About the author
Associate Orion Elenzil
Real Life Plus
but it relies on a few custom functions such as getScopeName().