How to: Run a Performance Session on a Web Application

This topic applies to:

Visual Studio Ultimate

Visual Studio Premium

Visual Studio Professional 

Visual Studio Express

Topic applies Topic does not apply Topic does not apply Topic does not apply

The performance session tools that Are Included in Visual Studio Premium let developers measure, evaluate, and target performance-related issues in their applications code. For more information, see Analyzing Application Performance by Using Profiling Tools.

Note

You should consider using the ASP.NET Profiler diagnostic and data adapter in the active test setting instead of using a profiler session on your Web application. However, the ASP.NET Profiler diagnostic and data adapter does not support profiling Cassini. For more information, see How to: Run a Load Test Containing Web Performance Tests that Collects ASP.NET Profiler Data.

With Visual Studio Ultimate you can create performance sessions on the Web application that is associated with your Web performance test to supplement your analysis. To obtain the data that you want to analyze, you must first create a performance session and then run the session. The Performance Wizard lets you do both.

Prerequisites

These are a few things that you must do before you start profiling to make sure that you do not encounter preventable problems.

  • Run as administrator   If you are not an administrator on the computer that you are using, you should run Visual Studio as an administrator to make sure that you have the permissions that are required for some of the features in the Profiling Tools. To do this, click Start, locate the Visual Studio program icon, right-click the icon, and then click Run as administrator.

  • **Set the active build configuration to Release   **Debug builds insert additional diagnostic code into your application and do not include optimizations that the compiler performs in release builds. Profiling the release version of your application provides more accurate data about the performance of your application. To change the active configuration, on the Build menu click Configuration Manager and in the dialog box, under Active solution configurations, select Release.

  • Get Windows symbols files   If you profile code that calls Windows functions, you should make sure that you have the most current .pdb files. Without these files your report views will list Windows function names that are cryptic and difficult to understand. For more information about how to make sure that you have the files that you need, see How to: Reference Windows Symbol Information.

To create and run a performance session on a Web application

  1. Verify that you have met the prerequisites listed in the previous section.

  2. Open either a Web performance test or a load test that contains a Web performance test.

  3. In either the Web Performance Test Editor or the Load Test Editor's toolbar, click Create performance session for this test.

    The Performance Wizard appears. The first page displays the name of the load test under A performance session will be created for the following test. For more information, see Profiling Tools Performance Session Overview.

  4. Click Next.

    The Specify the profiling method page appears.

  5. Select the profiling method that you want to use on your load test. The default setting of CPU Sampling (recommended). For more information, see Understanding Profiling Methods.

    Note

    For load testing, the CPU sampling profiling mode has very low overhead. Therefore, it is the ideal mode. Instrumentation and memory profiling modes have much higher overheads. Therefore, they are not recommended for load testing. However, any mode will work.

    For more information, see Understanding Profiling Methods.

  6. Click Next.

    The Select a Web Application to collect performance data on page appears.

  7. Use the drop-down list under Which application should be targeted to specify the Web application associated with the load test.

  8. Click Next.

    The You have completed specifying settings for your new performance session page appears.

  9. If you want to start profiling the Web application when you finish the Performance Wizard, verify that the Launch profiling after the wizard finishes check box is selected.

  10. Click Finish.

    Your profiler starts to collect data on your Web application.

    -or-

    If you want to profile the Web application later, clear the Launch profiling after the wizard finishes check box and click Finish.

    After the profiler finishes running, the Summary view of the profiling data appears in the main Visual Studio window and an icon for the new session appears in the Performance Explorer window.

    Web application performance session summary report

    Web application perfromance session data

  11. Use the Current View drop-down list to see additional views of the performance session data including:

    • Call Tree

    • Modules

    • Caller / Callee

    • Functions

    • Lines

    • Marks

    • Processes

    • Function Details

    • IPs

    For more information, see Profiling Tools Report Overview.

See Also

Concepts

Analyzing Application Performance by Using Profiling Tools

Load Test Analyzer Overview

Other Resources

Editing Load Test Using the Load Test Editor

Customizing Web Performance Test Recordings Using Web Performance Test Editor