Analyzing Win32 File IO performance in Timing Captures

Steven Pratschner


PIX Timing Captures include an option to collect data on your title’s use of the Win32 file IO APIs to access files. The data collected for calls to APIs such as ReadFile and WriteFile include the name of the file being accessed, and the offset, size and duration of the access itself. Full callstacks for each file access are also recorded. This timing data is displayed in the Timeline, Range Details, and Element Details views in Timing Captures.

Capturing Win32 File IO data

To capture data on Win32 file accesses, select the File accesses check box when starting a Timing Capture as shown in the following figure.

Image pix timing fileio capture options

Analyzing Win32 File IO accesses in Timing Captures

PIX creates an IO lane in the Timeline for each drive on the PC from which files were read. Individual file access are represented by a colored rectangle that contains the name of the file that was accessed. The start of each rectangle and it’s length represent the start time and duration of the access. Details of each access are provided in a tooltip.

The following picture shows several reads of a file named ExampleFileData.dat on the E: drive. Note that several rectangles indicating accesses of ExampleFileData.dat overlap in time and are stacked on top of each other in the lane. This visualization represents several concurrent reads of the file.

Image pix timing fileio timeline

To view Win32 File IO data in a tabular form, select a range of time in the Timeline and choose the File IO Events item from the Items to Show dropdown in the Range Details view. Viewing timing data in a table is useful for certain scenarios such as sorting the table by the file accesses that took the longest time to complete.

Image pix timing fileio range details

Selecting a row in Range Details populates the Element Details view with more detailed data about the file access, including the callstack in your title that initiated the access. Use the Show in Timeline button to scroll the Timeline to the point in time when the access occurred.

Image pix timing fileio element details

Win32 File IO Lane Configurations

The Lane Selector panel and the Lane Configurations list box can be used to customize the appearance of IO lanes as shown in the following picture. Options to reorder lanes, to display or hide specific lanes, to adjust the color and marker height, and other options are provided.

Image pix timing fileio config


Comments are closed. Login to edit/delete your existing comments