Course contentsShow
← Unreal Engine Game Development
Lesson 777 of 88011. Performance Profiling and OptimizationFree lesson

Isolating Performance Spikes with Stat Commands

Master the use of stat commands to monitor real-time thread timing and identify specific frames causing performance degradation.

In this lesson, you will learn how to leverage Unreal Engine’s real-time stat commands to surgically isolate the exact frame and thread responsible for sudden performance hitches during live gameplay.

When your frame rate drops, it is rarely a constant issue; it is usually a "spike" caused by a specific operation—like a heavy physics calculation, a complex blueprint tick, or an expensive material update. While Unreal Insights provides a post-mortem analysis, stat commands are your go-to tool for identifying these culprits in real-time.

Monitoring Thread Execution

To catch a spike, you need to see the frame times for the three critical threads: the Game Thread, the Draw (Render) Thread, and the GPU. Open the console with the tilde (~) key and enter:

stat unit

This displays the Frame, Game, Draw, and GPU times in milliseconds. If Frame spikes but Game remains low, your bottleneck is likely in rendering; if Game spikes, you have heavy gameplay logic.

Isolating the Culprit

Once you’ve confirmed which thread is spiking, you need to drill down into that thread’s specific tasks. Use these specialized commands to expose high-level sub-processes:

  • stat game: Breaks down the Game Thread, showing you the costs of Tick, Blueprint, and Actor updates.
  • stat engine: Displays high-level engine overhead.
  • stat rendering: Shows general rendering costs.

If you observe a consistent spike every time you perform a specific action (like spawning an enemy or triggering a particle system), enable the relevant stat group and watch the milliseconds jump. For example, if your blueprints are the issue, stat game will often highlight BlueprintTick as the major contributor.

Capturing Spikes

To catch fleeting spikes that disappear too quickly to read, use:

stat dumpframe -ms=15

This command dumps the stats of any frame that exceeds 15ms to your output log. By reviewing the Saved/Logs file after a stutter, you can correlate specific function calls or system updates to the exact frame where your performance budget was violated.

Key Takeaway: Use stat unit to identify the bottlenecked thread, then layer in granular stat groups to pinpoint the specific engine system or gameplay function responsible for the spike.