Search public documentation:
- Basic Profiling and Optimization Techniques
- STAT Commands
- Preparing the Profiling Environment
- Tips and Tricks
- Boot Time Profiling
The following sections will help you understand the most useful tools for tracking down performance problems, bottlenecks, and hitches. Usually the first order of business is determining whether your frame is limited by CPU or GPU performance, and then using the appropriate tools to narrow down the problem. If the CPU is running slowly there are many commands and debugging tools available to help with this. Sometimes there are simply too many actors and other "moving parts" causing a frame to be slow, or maybe a renegade AI class is firing thousands of ray casts per frame. With some patience you can track these perf issues right down to the individual level actor! For GPU performance you may need to use PIX to analyze draw events or shader performance, as well as in-game visualization modes and HUD stats. Sometimes these problems can be traced to content layout or lighting properties. In either case you may be dealing with sustained frame rate problem or a hitch (large frame time spike.) For sustained poor frame rate, single-frame capture tools (such as the TRACE command) and sampling profilers (VTune, etc) may be very useful. For hitches, you'll want to make use of the StatsViewer tool to analyze historical frames using a call graph. Note that consoles will generally have different performance debugging tools than PC, although many of the Unreal tools will work on multiple platforms.
When debugging, testing, or profiling games, the ability to quickly and easily see and evaluate meaningful data directly in the game is imperative. Through the use of the STAT console command, Unreal Engine 3 provides the ability to view any number of statsistics about various aspects of the game and engine as data rendered to the screen as a heads-up display. The Stat Command Descriptions page contains a complete listing of all the stat commands available as well as descriptions of the various metrics shown by each command.
- First, make sure to always have STAT UNIT up while you're running the game
- Make sure to turn off any log spam or debug code that will taint performance results
- Turn off garbage collection verification because it will contribute to hitching
- Disable VSync so you can identify bottlenecks, even on fast frames
- Pass the -NoVerifyGC command-line argument.
- Pass the -NoVSync command-line option to the game.
- Or, enable the "No VSync" checkbox in the Game tab of Unreal Frontend.
STAT SLOW 0.01 10This will render all cycle stats that have been > 10 ms in the last 10 seconds.
The following sections contain tips and tricks to keep in mind when profiling for performance issues.
- Enemies that are far away from the player don't often need to spawn small blood decals on the ground (e.g. being shot blood effects)
- Enemies that the LD knows the player will never be able to get reach (e.g. enemies on a cliff that is unreachable) don't need to spawn blood pools or drop weapons
- Instead of optimizing a complex SkeletalControl, just don't update it when the owner is not visible
- Instead of simulating cloth when the cloth is not scene, just don't! :-)
- Place N of the problematic object in a test level