Rapid Web Site Profiling with VSPerfASPNETCmd
The VSPerfASPNETCmd command line tool enables you to easily profile ASP.NET Web applications. In comparison to the VSPerfCmd command line tool, options are reduced, no environment variables have to be set, and rebooting the computer is not required. Using VSPerfASPNETCmd is the preferred method for profiling with the standalone profiler. For more information, see How to: Install the Stand-Alone Profiler.
In some scenarios, such as collecting concurrency data or pausing and resuming profiling, using VSPerfCmd is the preferred profiling method.
Command-line tools of the Profiling Tools are located in the \Team Tools\Performance Tools subdirectory of the Visual Studio installation directory. On 64 bit computers,, use the VSPerfASPNETCmd tool located in the 32 bit \Team Tools\Performance Tools directory. To use the profiler command-line tools, you must add the tools path to the PATH environment variable of the command prompt window or add it to the command itself. For more information, see Specifying the Path to Profiling Tools Command Line Tools.
To profile an ASP.NET Web application, type one of the commands described in the following sections. The Web site is started and the profiler starts to collect data. Exercise your application and then close the browser. To stop profiling, press the Enter key in the command prompt window.
By default, the command prompt does not return after a vsperfaspnetcmd command. You can use the /nowait option to force the command prompt to return. See Using the /NoWait option.
Use the following command line to collect detailed timing data from a dynamically compiled ASP.NET Web application:
vsperfaspnetcmd /trace websiteUrl
If you want to profile statically compiled .dll files in your Web application, you must instrument the files by using the VSInstr command-line tool. The vsperfaspnetcmd /trace command will include data from the instrumented files.
The /Memory option collects data about the allocation of objects in .NET memory and can collect data about the lifetime of those objects. Allocation data collection is the default mode of the /Memory data option and does not have to be specified on the command line.
vsperfaspnetcmd /memory websiteUrl
Use the Lifetime parameter to collect object lifetime data in addition to the allocation data:
vsperfaspnetcmd /memory:lifetime websiteUrl
You can also use the /Trace option to include detailed timing information with the .NET memory data:
vsperfaspnetcmd /memory[:lifetime] /trace websiteUrl
By default, the command prompt does not return after a vsperfaspnetcmd command. You can use the following syntax option to force the command prompt to return. You can then perform other operations in the command prompt window. To end profiling, use the /shutdown option in a separate vsperfaspnetcmd command.
To begin profiling:
vsperfaspnetcmd [/Options] /nowait websiteUrl
To end profiling:
vsperfaspnetcmd /shutdown websiteUrl
You can add any of the following options to the commands listed earlier in this section, except the vsperfaspnetcmd /shutdown command.
By default, the profiling data (.vsp) file is created in the current directory with the file name PerformanceReport.vsp. Use the /output option to specify a different location, file name, or both.
By default, VsPerfASPNETCmd embeds symbols (function and parameter names, etc) in the .vsp file. Embedding the symbols can make the profiling data file very large. If you will have access to the .pdb files that contain the symbols when you analyze the data, use the /packsymbols:off option to disable the embedding of the symbols.