Microsoft Developer Network

Documentation for Windows SDK Tools

Windows Performance Toolkit (WPT)

Introduction to WPT

The Windows Performance Toolkit (WPT) is a suite of powerful tools designed to help you diagnose and resolve performance issues on Windows systems. It includes the Windows Performance Recorder (WPR) and Windows Performance Analyzer (WPA), enabling comprehensive system tracing and analysis.

WPT is essential for:

  • Identifying performance bottlenecks in applications and the operating system.
  • Understanding system behavior during specific scenarios.
  • Optimizing resource utilization for better responsiveness and efficiency.
  • Debugging complex performance-related problems.

Key Components

Windows Performance Recorder (WPR)

WPR is used to capture detailed system performance data. It can record CPU usage, disk I/O, memory allocation, registry activity, and much more. You can configure WPR to capture specific events or use predefined profiles for common scenarios.

Windows Performance Analyzer (WPA)

WPA is the analysis component of WPT. It visualizes the data captured by WPR in various graphs and tables, allowing you to drill down into performance metrics, compare different traces, and identify the root cause of performance issues.

Profiling Scenarios

WPT supports various profiling scenarios, including general system performance, application responsiveness, resource contention, and boot performance. Choosing the right scenario ensures you capture the most relevant data.

Getting Started with WPT

To begin using WPT, ensure you have the Windows SDK installed. WPT tools are typically found within the SDK installation directory.

Recording a Trace with WPR

You can record a trace using the command line. Here's a basic example:

wpr.exe -start General -file C:\traces\my_trace.etl -numIterations 1 - 

This command starts a general system trace, saves it to C:\traces\my_trace.etl, and records for one iteration.

Stopping a Trace

To stop the trace:

wpr.exe -stop C:\traces\my_trace.etl 

Analyzing a Trace with WPA

Once you have a trace file (.etl), you can open it with the Windows Performance Analyzer:

  1. Launch Windows Performance Analyzer.
  2. Go to File > Open and select your .etl file.
  3. Add the relevant analysis stacks and graphs from the Graph Explorer to understand your system's performance.

Common Use Cases

  • Application Performance Tuning: Analyze CPU, memory, and disk usage of your application to identify areas for optimization.
  • System Responsiveness Analysis: Understand why your system feels slow or unresponsive by examining thread scheduling, latency, and resource contention.
  • Boot Performance Optimization: Diagnose slow boot times by analyzing the sequence of events and resource usage during the startup process.
  • Driver and System Component Debugging: Investigate performance-related issues caused by drivers or other low-level system components.