Skip to content

Commit d59e295

Browse files
authored
Merge pull request #6250 from Mikejo5000/mikejo-br17
Discovery work for PerfTips
2 parents 950071f + 1042dcc commit d59e295

8 files changed

+51
-26
lines changed

docs/profiling/beginners-guide-to-performance-profiling.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ms.workload:
2020
---
2121
# Measure application performance by analyzing CPU usage
2222

23-
You can use Visual Studio profiling tools to analyze performance issues in your application. This procedure shows how to use **CPU Usage** tab of the Diagnostics Tools to obtain performance data for your app.
23+
You can use Visual Studio profiling tools to analyze performance issues in your application. This article shows how to use **CPU Usage** tab of the Diagnostics Tools to obtain performance data for your app, and also provides information on using PerfTips.
2424

2525
When the debugger pauses, the **CPU Usage** tool collects information about the functions that are executing in your application. The tool lists the functions that were performing work, and provides a timeline graph you can use to focus on specific segments of the sampling session.
2626

@@ -45,8 +45,7 @@ In this tutorial, you will:
4545

4646
2. Set a second breakpoint at the end of the function or region of code that you want to analyze.
4747

48-
> [!TIP]
49-
> By setting two breakpoints, you can limit data collection to the parts of code that you want to analyze.
48+
By setting two breakpoints, you can limit data collection to the parts of code that you want to analyze.
5049

5150
3. The **Diagnostic Tools** window appears automatically unless you have turned it off. To bring up the window again, click **Debug** > **Windows** > **Show Diagnostic Tools**.
5251

@@ -72,10 +71,16 @@ In this tutorial, you will:
7271

7372
When you choose **Record CPU Profile**, Visual Studio will begin recording your functions and how much time they take to execute. You can only view this collected data when your application is halted at a breakpoint.
7473

74+
> [!TIP]
75+
> To help analyze performance, you can also use [PerfTips](../profiling/perftips.md) to step through code and identify how long it takes particular functions or code blocks to complete.
76+
7577
8. Hit F5 to run the app to your second breakpoint.
7678

7779
Now, you now have performance data for your application specifically for the region of code that runs between the two breakpoints.
7880

81+
>[!TIP]
82+
> When paused at a breakpoint or a code-stepping operation, you can also analyze performance using [PerfTips](#analyze-performance-using-perftips).
83+
7984
The profiler begins preparing thread data. Wait for it to finish.
8085

8186
![Diagnostics Tools Preparing Threads](../profiling/media/diag-tools-preparing-data.png "DiagToolsPreparingThreads")
@@ -90,6 +95,9 @@ In this tutorial, you will:
9095

9196
At this point, you can begin to analyze the data.
9297

98+
> [!TIP]
99+
> When trying to identify performance issues, take multiple measurements. Performance naturally varies from run-to-run, and code paths typically execute slower the first time they run due to one-time initialization work such as loading DLLs, JIT compiling methods, and initializing caches. By taking multiple measurements, you get a better idea of the range and median of the metric being shown, whichs allow you to compare the first time versus the steady state performance of an area of code.
100+
93101
## Step 2: Analyze CPU usage data
94102

95103
We recommend that you begin analyzing your data by examining the list of functions under CPU Usage, identifying the functions that are doing the most work, and then taking a closer look at each one.
@@ -150,6 +158,12 @@ We recommend that you begin analyzing your data by examining the list of functio
150158
> [!NOTE]
151159
> If you see code in the call tree marked as "broken" code or "unwalkable stack", this indicates that Event Tracing for Windows (ETW) events were likely dropped. Try collecting the same trace a second time to resolve the issue.
152160
161+
## Analyze performance using PerfTips
162+
163+
While running code in the debugger, you can also use [PerfTips](../profiling/perftips.md) for in-depth performance analysis. Using PerfTips, you can view performance information while interacting with your code. You can check information such as the duration of the event (measured from when the debugger was last paused, or when the app started). For example, if you step through code (F10, F11), PerfTips show you the app runtime duration from the previous step operation to the current step.
164+
165+
![Analyze with PerfTips](../profiling/media/diag-tools-perftips.png "AnalyzeWithPerfTips")
166+
153167
## View external code
154168

155169
External code are functions in system and framework components that are executed by the code you write. External code include functions that start and stop the app, draw the UI, control threading, and provide other low-level services to the app. In most cases, you won't be interested in external code, and so the CPU Usage tool gathers the external functions of a user method into one **[External Code]** node.

docs/profiling/index.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ landingContent:
5454
linkLists:
5555
- linkListType: how-to-guide
5656
links:
57+
- text: PerfTips
58+
url: perftips.md
5759
- text: Measure CPU usage from the command line
5860
url: profile-apps-from-command-line.md
5961
- text: Measure memory usage for .NET objects
6062
url: dotnet-alloc-tool.md
61-
- text: PerfTips
62-
url: perftips.md
6363
- text: Analyze resource consumption (XAML)
6464
url: application-timeline.md
6565
- text: Analyze GPU usage (Direct3D)
26 KB
Loading

docs/profiling/profiling-feature-tour.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,24 @@ Double-click on a function that you are interested in, and you will see a more d
4848

4949
![Diagnostic Tools caller callee "butterfly" view](../profiling/media/prof-tour-cpu-usage-caller-callee.png "Diagnostic Tools Caller Callee View")
5050

51+
> [!TIP]
52+
> To help analyze performance, you can also use [PerfTips](#examine-performance-events-using-perftips) to step through code and identify how long it takes particular functions or code blocks to complete.
53+
54+
## Examine performance events using PerfTips
55+
56+
Often, the easiest way to view performance information is to use [PerfTips](../profiling/perftips.md). Using PerfTips, you can view performance information while interacting with your code. You can check information such as the duration of the event (measured from when the debugger was last paused, or when the app started). For example, if you step through code (F10, F11), PerfTips show you the app runtime duration from the previous step operation to the current step.
57+
58+
![Profiling Tour PerfTips](../profiling/media/prof-tour-perf-tips.png "Profiling Tour PerfTips")
59+
60+
You can use PerfTips to examine how long it takes for a code block to execute, or how long it takes for a single function to complete.
61+
62+
PerfTips show the same events that also show up in the **Events** view of the Diagnostic Tools. In the **Events** view, you can view different events that occur while you are debugging, such as the setting of a breakpoint or a code stepping operation.
63+
64+
![Diagnostic Tools Events view](../profiling/media/prof-tour-events.png "Diagnostic Tools View Events")
65+
66+
> [!NOTE]
67+
> If you have Visual Studio Enterprise, you can also see [IntelliTrace events](../debugger/intellitrace.md) in this tab.
68+
5169
## Analyze memory usage
5270

5371
The **Diagnostic Tools** window also allows you to evaluate memory usage in your app. For example, you can look at the number and size of objects on the heap. For more detailed instructions to analyze memory, see [Analyze memory usage](../profiling/memory-usage.md).
@@ -62,19 +80,6 @@ When you select one of the arrow links, you are given a differential view of the
6280

6381
If you click the link on the left instead in the **Memory Usage** view, the heap view is organized by object count; the objects of a particular type that increased the most in number are shown at the top (sorted by **Count Diff** column).
6482

65-
## Examine performance events
66-
67-
The **Events** view in the Diagnostic Tools shows you different events that occur while you are debugging, such as the setting of a breakpoint or a code stepping operation. You can check information such as the duration of the event (measured from when the debugger was last paused, or when the app started). For example, if you step through code (F10, F11), the **Events** view shows you the app runtime duration from the previous step operation to the current step.
68-
69-
![Diagnostic Tools Events view](../profiling/media/prof-tour-events.png "Diagnostic Tools View Events")
70-
71-
> [!NOTE]
72-
> If you have Visual Studio Enterprise, you can also see [IntelliTrace events](../debugger/intellitrace.md) in this tab.
73-
74-
The same events also show up in the code editor, which you can view as PerfTips.
75-
76-
![Profiling Tour PerfTips](../profiling/media/prof-tour-perf-tips.png "Profiling Tour PerfTips")
77-
7883
## <a name="post_mortem"></a> Profile release builds without the debugger
7984

8085
Profiling tools like CPU Usage and Memory Usage can be used with the debugger (see earlier sections), or you can run profiling tools post-mortem using the Performance Profiler, which is intended to provide analysis for **Release** builds. In the Performance Profiler, you can collect diagnostic info while the app is running, and then examine the collected information after the app is stopped. For more information on these different approaches, see [Run profiling tools with or without the debugger](../profiling/running-profiling-tools-with-or-without-the-debugger.md). Additional tools such as the [.NET Object Allocation tool](../profiling/dotnet-alloc-tool.md) are also available in the Performance Profiler.

docs/profiling/quickstart-cpu-usage-aspnet.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,10 @@ Windows 8 and later is required to run profiling tools with the debugger (**Diag
205205

206206
![Set breakpoints for profiling](../profiling/media/quickstart-cpu-usage-breakpoints-aspnet.png)
207207

208-
> [!TIP]
209-
> By setting two breakpoints, you can limit data collection to the parts of code that you want to analyze.
208+
By setting two breakpoints, you can limit data collection to the parts of code that you want to analyze.
209+
210+
>[!TIP]
211+
> When paused at a breakpoint or a code-stepping operation, you can also analyze performance using [PerfTips](../profiling/perftips.md).
210212

211213
1. The **Diagnostic Tools** window is already visible unless you have turned it off. To bring up the window again, click **Debug** > **Windows** > **Show Diagnostic Tools**.
212214

docs/profiling/quickstart-cpu-usage-managed.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,10 @@ Windows 8 and later is required to run profiling tools with the debugger (**Diag
187187

188188
![Set breakpoints for profiling](../profiling/media/quickstart-cpu-usage-breakpoints.png "Set breakpoints for profiling")
189189

190-
> [!TIP]
191-
> By setting two breakpoints, you can limit data collection to the parts of code that you want to analyze.
190+
By setting two breakpoints, you can limit data collection to the parts of code that you want to analyze.
191+
192+
>[!TIP]
193+
> When paused at a breakpoint or a code-stepping operation, you can also analyze performance using [PerfTips](../profiling/perftips.md).
192194

193195
3. The **Diagnostic Tools** window is already visible unless you have turned it off. To bring up the window again, click **Debug** > **Windows** > **Show Diagnostic Tools**.
194196

docs/profiling/quickstart-cpu-usage-native.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,10 @@ Windows 8 and later is required to run profiling tools with the debugger (**Diag
136136

137137
![Set breakpoints for profiling](../profiling/media/quickstart-cpu-usage-breakpoints-cplusplus.png "Set breakpoints for profiling")
138138

139-
> [!TIP]
140-
> By setting two breakpoints, you can limit data collection to the parts of code that you want to analyze.
139+
By setting two breakpoints, you can limit data collection to the parts of code that you want to analyze.
140+
141+
>[!TIP]
142+
> When paused at a breakpoint or a code-stepping operation, you can also analyze performance using [PerfTips](../profiling/perftips.md).
141143
142144
3. The **Diagnostic Tools** window is already visible unless you have turned it off. To bring up the window again, click **Debug** > **Windows** > **Show Diagnostic Tools**.
143145

docs/profiling/toc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
items:
2727
- name: CPU usage
2828
href: cpu-usage.md
29+
- name: Use PerfTips
30+
href: perftips.md
2931
- name: Memory usage
3032
items:
3133
- name: Analyze memory usage
@@ -42,8 +44,6 @@
4244
href: gpu-usage.md
4345
- name: Analyze Resource Consumption
4446
href: application-timeline.md
45-
- name: Use PerfTips
46-
href: perftips.md
4747
- name: Analyze Network usage
4848
href: network-usage.md
4949
- name: Analyze JavaScript memory

0 commit comments

Comments
 (0)