SuperProfiler is a library I wrote to help us track down performance issues in Zero Gear. It is open source so anyone can use it (and hopefully help make it better!).
You simply place a piece of code at the start of any function you want to profile and SuperProfiler takes care of the rest.
An example…
void SomeFunction2(int var1)
{
SUPER_PROFILE(”void SomeFunction2(int var1)”);
var1++;
}
void SomeFunction1(void)
{
SUPER_PROFILE(”void SomeFunction1(void)”);
int lala = 2;
SomeFunction2(1);
}
void main(void)
{
SomeFunction1();
SuperProfiler::TextOutput textOutput(”SuperProfilerResults.txt”);
SuperProfiler::Root::OutputResults(textOutput));
}
and in SuperProfilerResults.txt is…
Function List | Total Run Time=0 | Total Profiled Function Calls=2
—————————————–
void SomeFunction1(void) | Total Time=0.00 | 50.00% of time | Total Calls=1 | 50.00% of calls
void SomeFunction2(int var1) | Total Time=0.00 | 50.00% of time | Total Calls=1 | 50.00% of calls
Call Tree
—————————————–
ROOT
void SomeFunction1(void) | Avg Time=0.0000 | Times called=1
void SomeFunction2(int var1) | Avg Time=0.0000 | Times called=1
Simple and easy. Check out the Google code site for all the juicy details.
Let me know if you find it useful!