TorqueProfTool is a python script which can be used to convert the profiler output from the Torque3D engine into a json format profile which can be visualized using tools such as gprof2dot and graphviz.
The Wiki contains a detailed look at a profiler dump.
The following call-graph was generated from the profiler dump of the Pacific demo scene from Torque3D.org, and shows all functions which consumed at least 0.5% of the cpu time.
TorqueProfTool was used to convert the profiler dump into json format which could then be visualized using gprof2dot and graphviz.
In addition to the profile conversion, torqueProfTool also reports some key metrics:
ticks - the number of times that the simulation was ticked
renders - the number of the times that the screen was re-drawn
max framerate - an estimate of the maximum framerate during the profiled period
The following metrics were obtained from the profiler dump above:
ticks: 3343
renders: 3343
max framerate: 31.25
Python (Tested with python 2.7.6)
gprof2dot for conversion to other graph formats.
GraphViz to visualize the call graph.
xdot for interactive visualization (requires PyGTK)
Either clone the repository using git clone https://github.com/GuyAllard/TorqueProfTool
or download this zip and extract it to the desired location.
Add the TorqueProfTool directory to your system PATH variable.
torqueProfTool.py [options] [file] ...
Options:
-h, --help show the help message and exit
-r ROOT_FUNC, --root=ROOT_FUNC Name of function to use as the root node
-o OUT_FILENAME, --output-file=OUT_FILENAME Name of file to write output to
To reproduce the example graph above as a png image named pacific.png
torqueProfTool.py profilerDumpToFile241587.txt | gprof2dot -f json | dot -Tpng -o pacific.png
or alternatively, to use xdot for the visualization,
torqueProfTool.py profilerDumpToFile241587.txt | gprof2dot -f json | xdot -