Skip to content

GuyAllard/TorqueProfTool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TorqueProfTool

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.

Example

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.
pacific call graph

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

Requirements

Python (Tested with python 2.7.6)

Optional

gprof2dot for conversion to other graph formats.
GraphViz to visualize the call graph.
xdot for interactive visualization (requires PyGTK)

Installation

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.

Usage

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 -

About

A tool to manipulate the profiler output from Torque3D

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages