Difference between revisions of "Profiling"

From VDrift
Jump to: navigation, search
(New page: VDrift uses the GNU profiler, gprof. To use it, recompile VDrift with "scons profiling=1", then run the VDrift executable and perform activities that you'd like to profile. After exiting, ...)
 
m (Formatting style updates)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
VDrift uses the GNU profiler, gprof. To use it, recompile VDrift with "scons profiling=1", then run the VDrift executable and perform activities that you'd like to profile. After exiting, simply run gprof on the executable.
+
There are two profiling methods used to evaluate performance of VDrift code. VDrift provides its own in-game profiling system, or it may produce output suitable for the GNU gprof profiler.
 +
 
 +
==In-game Profiling==
 +
When VDrift is run with the <code>-profiling</code> command-line option, certain parts of the game code (determined by the developers and hard-coded in the source) are evaluated as the game runs.
 +
vdrift -profiling
 +
During execution, each profiled subsystem of the game is listed along the left side of the game window, along with the amount of time spent on that subsystem during the last tick. After VDrift exits, summarized profiling information is output to the '''stdout''' stream, including the percentage of time spent in each subsystem.
 +
 
 +
==Profiling with gprof==
 +
When VDrift is [[Compiling|compiled]] with the '''profiling''' [[Using SCons|option]] enabled, it produces output suitable for examination with the gprof tool.
 +
 
 +
Compiling with the '''profiling''' option enabled:
 +
scons profiling=1
 +
Run VDrift:
 +
build/vdrift
 +
After exiting, run gprof on the executable:
 +
gprof build/vdrift
 +
 
 +
 
 +
[[Category:Development]]

Latest revision as of 09:22, 27 August 2012

There are two profiling methods used to evaluate performance of VDrift code. VDrift provides its own in-game profiling system, or it may produce output suitable for the GNU gprof profiler.

In-game Profiling

When VDrift is run with the -profiling command-line option, certain parts of the game code (determined by the developers and hard-coded in the source) are evaluated as the game runs.

vdrift -profiling

During execution, each profiled subsystem of the game is listed along the left side of the game window, along with the amount of time spent on that subsystem during the last tick. After VDrift exits, summarized profiling information is output to the stdout stream, including the percentage of time spent in each subsystem.

Profiling with gprof

When VDrift is compiled with the profiling option enabled, it produces output suitable for examination with the gprof tool.

Compiling with the profiling option enabled:

scons profiling=1

Run VDrift:

build/vdrift

After exiting, run gprof on the executable:

gprof build/vdrift