Game Development Community

Profiling Torque

by Bruno · in Torque Game Builder · 12/03/2009 (5:05 pm) · 7 replies

Hi,

I'm tryng to profile Torque, to find where my game is spending most of his time.
Looking at this thread :

http://www.torquepowered.com/community/forums/viewthread/50268

It seems at the time, there was this function "profilerEnable".
Currently TGB doens't recognize it.
Is there a way to profile torque ?

thanks,
Bruno

#1
12/03/2009 (6:56 pm)
I just did
profilerEnable(true);
profilerDumpToFile("test.txt");
profilerEnable(false);
and it just worked.
#2
12/03/2009 (7:02 pm)
Did you write that on the console ?
When i type this, i just get :

<input> (0): Unable to find function profilerEnable

#3
12/03/2009 (8:52 pm)
I did just type it into the console.

I'm looking through the source code right now and the only thing I can tell is that the binary version is built as "TORQUE_SHIPPING". I always do a fresh "TORQUE_RELEASE" build with each new project, which enables profiling.

This seems like a mistake. Even though the profiler only gives C++, not TorqueScript, information, it is still useful. It can tell you whether you are rendering too many sprites, taking too much time on calculating mount node positions, calculating too many collisions, etc.

Anyway, I'd recommend doing a re-build in "Release", and you'll get profiling.
#4
04/14/2010 (8:25 pm)
TGE 1.5.2 has the function prototypes but their definitions don't exist ... they are missing from profiler.cc

Isnt TGB based off TGE -- can someone post the -> reset and -> dumpToFile() functions from the TGB base ??
#5
04/14/2010 (9:28 pm)
I guess I'm not sure what your question is. The functions are:

profilerEnable( <true | false> );
profilerDump();
profilerDumpToFile( <filename> );
profilerReset();

Are you looking for the ConsoleFunctions? The source for each function like
void Profiler::enable(bool enabled)
{
  mNextEnable = enabled;
}
?
#6
04/15/2010 (12:07 am)
Sorry for the confusion -- the reset and dumpToFile() dont exist in TGE.
(I realize this forum post is for TGB)

But looking at TGEA -- there are major differences in the profiler.

Thought perhaps the code was just missing but now I think they removed it from TGE 1.5.2 for some reason.

#7
04/15/2010 (4:51 am)
TGE is so much older than TGB 1.7.4 (1 or even 2 years older), its possible that it just didn't exist back then at all.