|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
How to: Profile with the Performance Wizard and Profiler Defaults
The Visual Studio Profiling Tools features and options enable you to completely control a profiling session. But in many cases, all that you need to discover performance issues in your project is to use the Performance Wizard to configure the session, the default settings of the Performance Explorer and Data Collection Control windows for data collection, and the standard Profiling Tools report views of the data.
This topic describes how to quickly profile a Windows client application by using the Performance Wizard and Profiling Tools default settings. The following procedures are described:
How to use the Performance Wizard to configure a performance session for a project.
How to collect performance data for an application, including how to insert marks in the profiling data file to assist in data analysis.
How to view and filter the performance data in the Visual Studio IDE.
How to use the Hot Path filter in the Call Tree view to find the functions in which your application spends the most time.
Because profiling can be complex, following the procedures in this topic will not guarantee that you identify a critical performance issue in your application. The topic is designed as an introduction to the Visual Studio Profiling Tools.
To create a performance session for Windows client application
Open the solution in the Visual Studio IDE.
On the Analyze menu, click Launch Performance Wizard.
From the Which of the following available targets would you like to profile? drop-down list, select the name of the application that you want to profile, and then click Next. You can add more binaries later.
Accept the default Sampling profiling method, and then click Next.
To collect performance data for the application
If the Performance Explorer is not displayed, point to the Analyze menu, point to Windows, and then select Performance Explorer.
Right-click the name of the performance session, and then select Launch with Profiling.
The Data Collection Control window appears.
Before you exercise the application functionality that you are interested in, select Mark One, and then click Insert Mark on the Data Collection Control toolbar.
Exercise the application functionality that you are interested in.
On the Data Collection Control toolbar, select Mark Two, and then click Insert Mark.
Shut down the application in the regular manner. The Profiling Tools processes the performance data and displays the Summary view in the Visual Studio IDE.
To filter the profiling data file to display the data collected between marks
On the data view toolbar, select Marks from the Current View list.
From the Mark Name list, select the rows that contain Mark One and Mark Two.
Right-click and select Add Filter On Marks.
Click Execute Filter on the data view filter.
To find the functions in your application that consume the most time
On the data view toolbar, select Call Tree from the Current View list.
On the data view toolbar, click Expand Hot Path.
Find the functions in your application that are on the hot path.