How to: Profile JavaScript (ECMA) Code in Web Pages
Visual Studio Profiling Tools can collect performance data for JavaScript code that executes in an ASP.NET Web application, an arbitrary Web page, or JavaScript application by using the instrumentation profiling method.
Requirements
Visual Studio Ultimate, Visual Studio Premium, Visual Studio Professional
Internet Explorer 8 or later.
Warning
To profile JavaScript in Windows Store apps, see one of the following topics:
You can use the Profiling Wizard to create a performance session. Specify the instrumentation method and then specify the JavaScript profiling option on the Instrumentation page of the properties dialog box for the performance session.
When you specify JavaScript profiling, both the JavaScript code that executes in the browser and the ASP.NET code that executes on the server are profiled.
For an ASP.NET Web application, both the JavaScript code that executes in the browser and the ASP.NET code that executes on the server are profiled.
For an arbitrary Web page, the JavaScript code that executes in the browser is profiled.
To profile JavaScript in an ASP.NET Web application project
In Visual Studio Premium, open the ASP.NET Web project.
On the Analyze menu, click Launch Performance Wizard.
On the first page of the Performance Wizard, specify the Instrumentation profiling method, and then click Next.
On the second page of the wizard, make sure that the current project is selected in the list of targets, and then click Next.
On the third page of the wizard, select the Profile JavaScript check box, and then click Next.
On the fourth page of the wizard, click Finish to start the Web application in the browser.
Exercise the functionality that you want to profile.
To end the profiling session, close the browser.
To profile JavaScript in individual Web pages or a JavaScript applications
Open Visual Studio Premium.
On the Analyze menu, click Launch Performance Wizard.
On the first page of the Performance Wizard, specify the Instrumentation profiling method, and then click Next.
On the second page of the wizard, click An ASP.NET or JavaScript application, and then click Next.
On the third page of the wizard:
Type the URL of the page in the What URL or path will run your application box.
Select the Profile JavaScript check box, and then click Next.
On the fourth page of the wizard, click Finish to start the Web page in the browser.
Exercise the functionality that you want to profile.
To end the profiling session, close the browser.