Collecting Performance Statistics by Using Sampling

By default, the Visual Studio Premium Profiling Tools sampling method collects profiling information every 10,000,000 processor cycles (approximately every one-hundredth of a second on a 1 GHz computer). The sampling method is useful for finding processor utilization issues and is the suggested method for starting most performance investigations.


  • Visual Studio Ultimate, Visual Studio Premium, Visual Studio Professional

Note Note

Enhanced security features in Windows 8 and Windows Server 2012 required significant changes in the way the Visual Studio profiler collects data on these platforms. Windows Store apps also require new collection techniques. See Profiling Windows 8 and Windows Server 2012 applications.

You can specify the sampling method by using one of the following procedures:

  • On the first page of the Profiling Wizard, click CPU Sampling (recommended).

  • On the Performance Explorer toolbar, in the Method list, click Sampling.

  • On the General page of the properties dialog box for the performance session, click Sampling.

You can specify additional options in the Performance Session Property Pages dialog box of the performance session. To open this dialog box:

  • In Performance Explorer, right-click the performance session name, and then click Properties.

The tasks in the following table describe options that you can specify in the Performance Session Property Pages dialog box when you profile by using the sampling method.


Related Content

On the General page, add .NET memory allocation and lifetime data collection, and specify naming details for the generated profiling data (.vsp) file.

On the Sampling page, change the sampling rate, change the sampling event from processor clock cycles to another processor performance counter, or change both..

On the Launch page, specify the application to start and the start order if you have multiple .exe projects in your code solution.

On the Tier Interaction page, add ADO.NET call information to to the data collected in theprofiling run.

On the Windows Events page, specify one or more Event Tracing for Windows (ETW) events to collect with the sampling data.

On the Windows Counters page, specify one or more operating system performance counters to add to the profiling data as marks.

On the Advanced page, specify the version of the .NET Framework runtime to profile if your application modules use multiple versions. By default, the first version loaded is profiled.