Getting Started with Performance Analyzer

Welcome to the Performance Analyzer! This guide will walk you through the initial steps to start profiling your applications and identifying performance bottlenecks.

Prerequisites

  • Ensure you have the Performance Analyzer installed as part of the MSDN Developer Tools suite.
  • Your application should be built with debugging symbols enabled if you wish to see source code line information.
  • Administrator privileges may be required for certain system-level profiling scenarios.

Step 1: Launching the Performance Analyzer

Method 1: From the Start Menu

  1. Click the Start button.
  2. Navigate to All Programs -> MSDN Developer Tools -> Performance Analyzer.
  3. Click on Performance Analyzer to launch the application.

Method 2: From the Command Line

Open a command prompt or PowerShell window and type:

perf_analyzer.exe

Step 2: Creating a New Project

Once the Performance Analyzer is launched, you'll be greeted with the main interface. The first step is to create a new profiling project.

  1. Click on File -> New Project....
  2. In the "New Project" dialog, select the type of application you want to profile (e.g., Console Application, .NET Application, Native Application).
  3. Provide a name for your project and specify a location to save it.
  4. Click Create.

Step 3: Configuring the Profiling Session

After creating the project, you need to configure how the profiling will be performed.

  1. In the project explorer, right-click on your newly created project and select Properties.
  2. Navigate to the Profiling Settings section.
  3. Target Application: Specify the path to the executable you want to profile.
  4. Profiling Mode: Choose a profiling mode. Common options include:
    • CPU Sampling: Collects call stack information at regular intervals to identify CPU-intensive functions.
    • Instrumentation: Inserts measurement probes into your application's code to track function calls, execution times, and memory allocations.
  5. Launch Options: Configure how the target application should be launched (e.g., with specific command-line arguments).
  6. Click Apply and then OK.

Step 4: Running the Profiler

With your project configured, you're ready to start profiling.

  1. Ensure your target application is not already running.
  2. In the Performance Analyzer, click the Start Profiling button (often represented by a green play icon).
  3. The Performance Analyzer will launch your target application. Interact with your application as you normally would, performing the operations you suspect might be causing performance issues.
  4. Once you have completed the relevant operations, close your target application.
  5. The Performance Analyzer will automatically stop profiling and begin processing the collected data.
Important: For accurate results, ensure you perform representative workloads during the profiling session.

Step 5: Analyzing the Results

After the profiling session concludes, the Performance Analyzer will display detailed reports.

  • Overview Report: Provides a high-level summary of performance metrics.
  • Function List: Lists all functions called during the session, sorted by metrics like exclusive time, inclusive time, and call count.
  • Call Tree: Visualizes the call stack, showing how functions call each other and where time is spent.
  • Performance Counters: Displays system-level performance data relevant to your application.

Use these reports to pinpoint slow functions, identify excessive resource usage, and understand the flow of execution in your application.

Congratulations! You have successfully completed your first profiling session. Explore the different reports and features to gain deeper insights into your application's performance.