First Steps in Performance Optimization
When developing games with Unreal Engine 5 (UE5), everyone eventually faces performance issues like "frame rate drops" or "choppy gameplay." However, blindly changing settings won't solve the problem without knowing where the cause lies.
The first step in performance optimization is accurately identifying "where the bottleneck is." UE5 provides very powerful and fundamental tools for this problem identification. Those are the Stats console commands.
This article thoroughly explains how to use Stats commands, from basic usage to specific bottleneck identification procedures, from a practical perspective for UE5 beginners to intermediate developers.
What Are Stats Commands
Stats commands are debugging tools that display in real-time on screen how much time the CPU and GPU are spending on various processes during game execution. Using these, you can visually understand which part—rendering, game logic, physics—is the main culprit for frame rate drops.
Terminology: Frame Rate and Bottleneck
| Term | Meaning |
|---|---|
| Frame Rate (FPS) | The number of times the screen updates per second. Higher values mean smoother motion. |
| Frame Time (ms) | Time taken to render one frame (milliseconds). To achieve target FPS (e.g., 60FPS), frame time must be below its reciprocal (e.g., 16.67ms). |
| Bottleneck | The slowest element limiting overall system performance. Either CPU or GPU, or specific processing (e.g., rendering, physics) becomes the bottleneck. |
Using the stat unit Command
The starting point for performance investigation is the stat unit command. It quickly compares CPU and GPU processing times to determine which is the bottleneck.
Execution Method
During game execution (PIE or standalone), press the ` (backtick/tilde) key to open the console and enter the following command:
💡 About Console Key
By default, the backtick key opens the console. With Japanese keyboards, the half-width/full-width key may interfere and prevent opening. In that case, add a key in
Project Settings→Input→Console Keys, or addConsoleKeys=^etc. toDefaultInput.ini.
stat unit
You can also use stat unitgraph to visually confirm frame time variations as a graph.
Displayed Information and Interpretation
Information like the following is displayed in the upper right of the screen:
| Display Item | Meaning | Potential Bottleneck |
|---|---|---|
| Frame | Total processing time for one frame (ms). FPS drops when this exceeds target frame time. | Overall |
| Game | Processing time for game logic (Blueprint and C++ code) (ms). | CPU (Game Thread) |
| Draw | Processing time for draw calls (rendering commands) (ms). | CPU (Rendering Thread) |
| GPU | Processing time on the graphics card (GPU) (ms). | GPU |
Interpretation Points:
- When
Gameis high (e.g., 15ms+): CPU game logic is the bottleneck. Review complex Blueprints, excessive tick processing, AI processing, etc. - When
Drawis high (e.g., 15ms+): CPU rendering thread is the bottleneck. Possibly too many draw calls (too many objects) or material complexity. - When
GPUis high (e.g., 15ms+): GPU is the bottleneck. Causes include shader complexity, post-processing, high-resolution textures, overdraw, etc.
Detailed Stats Commands
Once you've identified the rough bottleneck with stat unit, use more detailed commands to pinpoint the cause.
CPU Bottleneck (When Game or Draw is High)
stat game
Displays detailed game thread processing times (AI, physics, tick, etc.).
stat scenerendering
Displays detailed rendering thread processing times (shadows, lighting, culling, etc.). Particularly useful when Draw is high.
stat streaming
Displays texture and geometry streaming status. Helps identify causes of loading stutters.
GPU Bottleneck (When GPU is High)
stat gpu
Displays detailed GPU processing. Shows which passes (Base Pass, Shadow Depths, Post Processing, etc.) are taking time.
stat rhi
Displays draw command execution status at the RHI (Rendering Hardware Interface) level. You can check draw call counts, primitive counts, etc.
Practical Combinations
| Bottleneck | First Command to Try | Next Command to Try |
|---|---|---|
| CPU (Game) | stat unit | stat game |
| CPU (Draw) | stat unit | stat scenerendering |
| GPU | stat unit | stat gpu |
Common Mistakes and Best Practices
Common Mistakes
- Not checking
stat unitbefore starting optimization: Spending time optimizing game logic (Blueprint) when GPU is the bottleneck leads to misdirected effort. Always checkstat unitto confirm whether CPU or GPU is the bottleneck. - Measuring in-editor: Running in-editor (PIE) is affected by editor overhead and debug features, making it unsuitable for accurate performance measurement. Standalone game or packaged builds are best practice for measurement.
- Being satisfied with
stat fps:stat fpsonly shows frame rate (FPS). It doesn't show frame time (ms) or CPU/GPU breakdown, making it insufficient for bottleneck identification. Always usestat unit.
Best Practices
- Ensure Problem Reproducibility: Measure at specific locations or situations where performance drops (e.g., the moment specific enemies appear, specific viewpoints).
- Account for Variation: Don't just look at instantaneous values; observe for several seconds to understand average and maximum values.
- Combine with Profilers: While
Statscommands excel at real-time overview, combining with profiling tools like UE5's Unreal Insights is essential for more detailed function-level analysis.
Key Points for Stats Command Usage
UE5 performance optimization should be based on accurate data, not intuition or experience. The most fundamental tool for this is Stats commands.
| Step | Command | Purpose |
|---|---|---|
| 1. Rough Identification | stat unit | Determine whether CPU (Game/Draw) or GPU is the bottleneck. |
| 2. Detailed Investigation | stat game / stat gpu etc. | Identify the bottleneck processing (AI, render pass, etc.). |
| 3. Optimization | None | Fix identified problem areas (Blueprint, material, settings, etc.). |
| 4. Re-measurement | stat unit | Verify optimization effectiveness. |
Mastering Stats commands is the first step toward achieving comfortable gaming experiences in UE5. Start by running stat unit in your project to check where the current bottleneck lies.