In this lesson, you will learn how to configure trace sessions and utilize Unreal Insights to capture high-fidelity performance data for deep analytical inspection.
While real-time console commands provide a snapshot of performance, Unreal Insights allows you to record granular telemetry over time, enabling you to identify micro-stutters and bottlenecked systems that occur across multiple frames. To capture this data, you must leverage the Trace system, which records event-based data from the engine into a .utrace file.
Initiating a Trace Session
You can start a trace session directly from the command line when launching your game. This is the preferred method for capturing high-fidelity data during startup, as it ensures no events are missed:
MyGame.exe -trace=cpu,gpu,loadtime,frame
The -trace argument accepts a comma-separated list of channels. Using cpu and frame is essential for performance profiling, as these capture CPU timings for scope blocks and frame-to-frame duration, respectively. Once the session is running, you can connect the Unreal Insights application (located in your Engine’s Binaries/Win64 folder) to your running process.
Configuring for High Fidelity
To ensure your data is useful for deep inspection, you may need to increase the trace buffer size if your application is under heavy load. If you notice "dropped" events in your trace, you can adjust the buffer settings in your DefaultEngine.ini:
[Trace.Channel]
bAutoConnect=true
BufferSize=1024
Once connected, Unreal Insights visualizes the trace data in a timeline. You can select specific CPU threads to observe nested function timings. Because Unreal Engine uses the TRACE_CPUPROFILER_EVENT_SCOPE macro throughout the codebase, you will see a detailed hierarchy of every timed block. By correlating these visual blocks with your gameplay events, you can pinpoint exactly which function or system is consuming excess time, allowing for targeted optimization of your game’s most expensive processes.
Key Takeaway: By launching with specific -trace channels and analyzing the resulting .utrace files in Unreal Insights, you transition from guessing about performance to performing precise, event-based diagnostics of your engine's internal operations.