The latest version of xperf/wpa/WPT (Windows Performance Toolkit) was released October 17, 2013 along with Windows 8.1. If you care about performance on Windows (or Xbox One – rumors tell me xperf is used there as well) then you need the latest version of this powerful tool.
This post is mostly obsolete since WPT 10 is now out. However the list of new features is still relevant. To get the latest version of WPT I recommend getting it with UIforETW.
This is just a quick post to explain why you should upgrade.
But first, why should Windows developers use xperf?
- It’s a free profiler that is more powerful for most uses than anything else available on Windows
- It includes a sampling profiler that records kernel and user CPU consumption at up to 8 kHz with very low overhead
- It records all running processes simultaneously
- It can record every context switch along with call stacks of the switched-in thread and the thread that triggered the context switch (the ready thread)
- It can record all file I/O, disk I/O (file I/O that went to the disk), GPU activity, the active window, available memory, etc.
- It can record custom user events such as frame boundaries that give context to the other data
- It allows definitive diagnosis of virtually any performance problem, in your own software or in others
Xperf ships with the Windows Software Development Kit so you can find the latest version through a search for Windows SDK 8.1, or just go to http://msdn.microsoft.com/en-us/library/windows/desktop/bg162891.aspx. If Windows 8.1 is not the latest version of Windows when you read this then you should probably search for a newer version.
There’s an official page describing what’s new in the Windows Performance Toolkit, but my what’s New Features section is better. I provide both editorial comments and links to the documentation of the new features!
Windows Performance Analyze (WPA – the trace viewing UI) offers the following new features:
- Support for multiple traces in a single session – the big ‘1’ when you open a trace is there in order to identify which trace you are looking at
- Comparative Analysis Views – you can now compare any summary table to find out what changed between two traces. You will need to read the linked instructions to figure this one out
- Regions of interest that allow you to highlight important time ranges in a trace – you can now auto-highlight and label important time ranges. This looks really valuable but I can’t get it to work in a sane way. If you figure it out let me know
- A new command line-based exporting tool – this could be really important since it gives lots of opportunities for automated analysis
- Support for Windows Store app analysis
- Instrumentation support for events that are fired through the System.Diagnostics.Tracing.EventSource class in .NET 4.5
Other things that I’ve noticed include:
- If you’ve recorded graphics data (DX provider) there will be a new Video section in WPA that lists GPU details such as GPU Usage – handy for finding whether a game is GPU bound or not
- The WPA colors are brighter
- Tooltips! I’ve been complaining for years that the excruciatingly subtle columns in the summary tables need documentation and tooltips. I’ve supplied the lost xperf documentation, and with WPA 8.1 Microsoft has supplied the tooltips.
Bugs and fixes
WPA is the trace viewer of choice for the xperf toolkit. Unfortunately the 8.0 and the 8.1 preview versions contained some annoying bugs that force me to use xperfview occasionally. These are now fixed. That’s a good thing since xperfview no longer ships with WPT. The bug fixes from the 8.0 version are:
- Numeric custom data (generic events) columns are now sorted numerically instead of alphabetically
- Custom data is now decoded reliably – previously WPA often had an off-by-one-byte error in the reading of data, causing corruption
I haven’t tested to see whether the bugs with putting control characters or multi-kB strings in custom event payloads are fixed, but those aren’t too hard to work around.
The only new bug I’ve encountered is that WPA crashes when loading one class of traces. I need to characterize that and figure out how to report the crashes (WPT is not one of the products accepting bug reports on connect.microsoft.com).
I’ll probably write more about these new features later. Until then the following articles are a good resource to get you get started:
- Xperf Basics: Recording a Trace (the ultimate easy way) – start at the beginning
- Xperf Symbol Loading Pitfalls – symbols are very important
- WPA–Xperf Trace Analysis Reimagined – an update for WPA
- Xperf for Excess CPU Consumption: WPA edition – go here if your CPU is busy
- Xperf Wait Analysis–Finding Idle Time – go here if your CPU is idle
- The Lost Xperf Documentation–CPU sampling
- The Lost Xperf Documentation–CPU Scheduling
- The Lost Xperf Documentation–Disk Usage