Profiling

From VDrift
Jump to: navigation, search

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