Tutorial: Navigating performance optimization with the Metrics View in PIX Timing Captures

Delve into powering up your PIX performance analysis with the Metrics View, a robust tool that’s engineered to offer invaluable insights to help optimize game performance metrics.

April 09, 2024
PIX Tutorial Hero image

Recently, our team created a series of videos to introduce developers to PIX, the game-focused profiling tool from Microsoft for Windows games. PIX is the profiler that’s used by game studios to optimize the PC build of their 64-bit, C++, and DirectX 12 games. Developers can use PIX to solve lots of performance issues that are common in games, including issues related to the GPU, CPU, memory, or file IO.

In this month’s video, we'll delve into the Metrics View in PIX Timing Captures. This graphical analysis tool is invaluable for diagnosing performance issues, and we'll explore it through the lens of a game developer who’s responsible for the Physics subsystem.

The Metrics View provides a wealth of information about the performance of your game, including how often your subsystem exceeds its performance budget and the distribution of its performance across frames.

Let's dive into the Metrics View layout in PIX. Using the Selector Panel, we can easily locate and select the PIX events that are related to the Physics subsystem. By adding these events to the graph and the Active Metrics panel, we can visualize the duration of these events throughout the capture.

The graph displays time on the x-axis and event duration on the y-axis, with each point representing the duration of a PIX event at a specific point in time. Hovering over a point reveals valuable statistics about the event, such as its average, minimum, and maximum duration.

Our analysis begins with focusing on a key event, Physics::Update, which measures the overall time spent in physics for each frame. With a performance budget of four milliseconds per frame, we can easily identify instances where the Physics subsystem exceeds this budget by adding a performance budget line to the graph.

Identifying points that surpass the budget allows us to investigate the causes behind these overruns. By zooming into the Timeline View for specific events, we can pinpoint stalls or bottlenecks on the physics thread that are contributing to performance issues.

Moving on to another critical event, Physics::PostUpdate, we observe significant variability in its duration. Adjusting the y-axis range and isolating this event on the graph, we can better visualize this variability. Using the Histogram control reveals distinct groupings of durations, prompting a deeper look into their causes.

By navigating to the timeline at the points corresponding to these duration groupings, we gain insights into the factors influencing the variability in event durations. This thorough analysis enables us to comprehensively understand the performance of the Physics subsystem.

In our next video, we'll explore how to use PIX to identify and address memory leaks. Stay tuned and until then, happy profiling!