Difference between revisions of "Profiling"

From VDrift
Jump to: navigation, search
m (3 revisions: Import from old wiki (on 15 May 2012))
m (Formatting style updates)
 
Line 3: Line 3:
 
==In-game Profiling==
 
==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.
 
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
 
  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.
 
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.
  
Line 12: Line 10:
  
 
Compiling with the '''profiling''' option enabled:
 
Compiling with the '''profiling''' option enabled:
 
 
  scons profiling=1
 
  scons profiling=1
 
 
Run VDrift:
 
Run VDrift:
 
 
  build/vdrift
 
  build/vdrift
 
 
After exiting, run gprof on the executable:
 
After exiting, run gprof on the executable:
 
 
  gprof build/vdrift
 
  gprof build/vdrift
  
  
 
[[Category:Development]]
 
[[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