The profiler in Visual Studio 2010 uses

Source: Internet
Author: User
Tags visual studio 2010

The profiler for Visual Studio 2010 is a self-contained performance tool that allows us to identify performance bottlenecks in the program and then continuously optimize for continuous re-testing.

Brief introduction

The profiler has two ways to test the modules that are connected to the program using the wizard launcher and later attached to the application:sampling (sampling) and Instrumentation (detection).

    • Sampling: Interrupts the computer processor at set intervals and collects the function call stack.
      The call stack is a dynamic structure that stores information about functions that are executing on the processor. The result of this analysis method is that each function is sampled at run time, the greater the number of times represents the greater the overhead. Because there is no need to change the source code, it is possible to start directly or later attach to the program under test.

    • Instrumentation: At the beginning and end of the target function in the source code file, and before and after each call of the function to the other function.
      The inserted code records the following information:

      1. The interval between this collection event and the previous collection event.
      2. Whether the operating system performed the operation during this interval.
        For example, the operating system might read or write to a disk, or switch between the target thread and another thread in another process.

According to "Tools\options\performance Tools\" under ' Show Time values as: ' The default setting is milliseconds, I think the sampling period should be millisecond, that is, the number of samples in the report can be approximately equal to milliseconds.

Use
    1. To start visual Studio with an administrator
    2. Programs for release version
    3. Set the PDB path required by the program

Through the ' analyze\launch performance Wizard ... ' or ' Analyze\profiler\attach or Detach ... ' to create a new performance session (performance session) for the program under test, we mainly introduce the next sampling through Attach to Report the analysis in case of process.
After the profiler begins, something like:

When you feel that you have collected enough information to stop, click ' Stop Profiling ', similar to:

The above interface is the summary of the report, and we begin to analyze the program's performance bottlenecks.

    • ' hot Path ' refers to a function with high sampling times, which is a performance bottleneck.

    • ' Inclusive Samples ' refers to the total number of times the function has been sampled, and plainly, the sum of the cost of the function itself and all the child functions it invokes.

    • ' Exclusive Samples ' refers to the number of times the function itself has been sampled, and plainly, that is, the function's own cost size, without the beginning of the child function it invokes.

    • ' funcions doding most individual work ' refers to a single function with the largest cost, so its indicator is ' Exclusive
      Samples ' to express.

With the introduction of the above, we can get the function of performance bottleneck, then we can get the full calling context according to call Tree.

For example, in the summary interface, click CallTree, Sort by ' Inclusive Samples ', follow the cost-size expansion method, and eventually get the overhead function context, similar to:

Of course, we can also use the above filter to choose "Modules", "Threads" and other ways to find the bottleneck of their own concern.
In addition, we can also select ' Show Just My Code ' and the appropriate CPU time period to filter on the summary interface.

Reference: Analyzing application Performance by Using Profiling Tools

The profiler in Visual Studio 2010 uses

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.