Performance Analysis Beginner's Guide

Performance Analysis Beginner's Guide

Can be used to analyze performance problems in your application using Visual Studio analysis tools. This procedure shows how to use the sample data.

Sampling is a statistical analysis method, it can display an application execution function mode of operation for most users. Sampling is to find a good starting point region for speed applications.

Sampling method specified intervals to collect information about the function of the application being executed. After completing the analysis operation, analysis of the data in the "Summary" view will show the most active relations function call tree, that is "hot route", which performed most of the work in the application. This view also lists the work performed up to the individual functions, and provides a timeline diagram, the sample may be dedicated to a particular portion of the session.

If the sample does not provide the required data collection methods other analytical tools that may be helpful to provide different kinds of information. For more information about these other methods, see How to: Select collection methods .

prompt

If the analysis code calls the Windows function, make sure you have the latest .pdb file. Without these documents, reports view lists cryptic, Windows function name is difficult to understand. For more information on how to ensure having the desired file, see How to: Reference Windows Symbol Information .

Step 1: Create and run a performance session

To obtain the data needed to be analyzed, you must first create a performance session, and then run the session. By Performance Wizard achieve both of these operations.

Without Windows desktop application or ASP.NET application performance analysis, you must use one of the other analysis tools. See analysis tools .

Creating and running performance session

  1. Open the solution in Visual Studio. Set the configuration to be published. (Found on the toolbar "solution configuration" box, by default it is set to "debug." Change it to "release.")

    important

    If you are not an administrator on the computer you are using, you should use the profiler to run Visual Studio as an administrator. (Visual Studio, right-click the application icon, and then click "Run as administrator."

  2. On the "Debug" menu, click "Performance Profiler."

  3. Check the "Performance Wizard" option and click "Start."

  4. Check the "CPU sampling (recommended)" option and click "Finish."

  5. Profiler application launcher and start collecting data.

  6. Exercise may contain functional performance problems.

  7. As usual close the application.

    After completing the application runs, the "Summary" view of the analysis of the data will be displayed in the main window in Visual Studio, and the icon for the new session are displayed in the "Performance Explorer" window.

Step 2: Analysis of sample data

Upon completion of the session running performance, analysis report "Summary" view is displayed in the main window of Visual Studio.

Data analysis is recommended to start by checking the "hot route", and then check the list of functions that perform most of the work, and finally by using the "Summary Timeline" will focus on other functions. See also analyze suggestions and warnings "Error List" window.

Note that the sampling method may not provide the required information. For example, only when the application is executing in user mode code when collecting samples. Thus, certain functions (such as input and output operations) are not captured sampled. It offers a variety of analysis tools enable you to focus on important data collection methods. For more information about other methods, see How to: Select collection methods .

FIG numbered in each region is associated with a process step.

Sampling summary report view

Data Analysis and Sampling

  1. "Summary" view, the "hot route" shows the application with the highest number of samples is called a non-exclusive relationship tree branch. This is the most active collecting data execution path. High values ​​may be indicative of non-exclusive call tree generating algorithms can be optimized. At least in the path of the code to find the function. Note that the path may also comprise a system function or functions of the external module.

    Thermal path profiler

    1. Non-exclusive sample indicating the completion of the function and any function call workload. Non-exclusive high point count total cost of the highest functions.
    2. Sample exclusive function indicating the code amount of work in the body, it does not include a function call to complete the work. Exclusive high count may indicate a performance bottleneck own internal functions.
  2. Click on a function name to display the "Detail" view of the analysis of the data. Data analysis "Detail" view is a graphic representation of the selected function, and displays all functions and all the functions the selected function calls the function call.

    • Calling and called block size represents the relative frequency function call or function call.
    • Click the name of the function call or calls, making it the "Detail" view of the selected function.
    • Lower "Detail" window pane displays the function code itself. If you examine the code and identify opportunities to optimize its performance, click the source file name to open the file in Visual Studio editor.
  3. To continue the analysis, please select from the list the "View" drop-down "summary" to return to the "Summary" view. Then check function "function to perform most of the work alone" in the. This list displays the highest exclusive function of the number of samples. These functions function body code execution in a lot of work, and you may be able to optimize it. To further analyze specific function, click the function name to display it in the "Detail" view.

    List perform most of the work function

    Survey To continue to run, may be displayed, "thermal path" and "up to perform a separate work function" of the selected segment by using the "summary" of the timeline view, so that a segment of the re-analysis of the data analysis. For example, focusing on the timeline may reveal smaller peak analysis function displays the call tree costly and not of the entire analytical run.

    To re-analysis section, in the "Summary Timeline" section select box, and then click "Filter By Selection."

    Performance Summary View Timeline

  4. Profiler also uses a set of rules to suggest ways to improve operational analysis and identify possible performance problems. If you find a problem, a warning is displayed in the "Error List" window. To open the "Error List" window, click the "Error List" in the "View" menu.

    • To view triggered a warning function in the "Detail" view, double-click the warning.
    • To view detailed information about the warning, right-click the error, and then click "Display Error Help"

Step 3: modifying the code and re-run the session

After finding and optimizing one or more functions can be run repeatedly analyzed and compared data to see the changes generated by the difference in application performance.

Modify the code and rerun the profiler

  1. Change the code.

  2. To open the "Performance Explorer", click on "Profiler" in the "Debug" menu, then click the "Performance Explorer", then click the "Show Performance Explorer."

  3. In the "Performance Explorer", right-click the session you want to re-run, and then click the "Start and enable the analysis."

  4. After re-run the session, another data file will be added to the "Performance Explorer" in session "Report" folder. Select the original and new analytical data, right-click the selection, then click "compare the performance report."

    Opens a new report window, and displays the result of the comparison. For more information about how to use comparison view, see How to: Compare the performance data file .

Guess you like

Origin www.cnblogs.com/fr-ruiyang/p/11227540.html