You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/profiling/choose-performance-tool.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,11 +33,12 @@ The following table lists the different tools Visual Studio offers and provides
33
33
|[Memory Usage](../profiling/memory-usage.md)|Shows your app’s memory to find issues such as memory leaks.|• Optimize memory usage</br>• Investigate UI freeze</br>• Investigate suspected memory leak (native code)|
34
34
|[.NET Object Allocation](../profiling/dotnet-alloc-tool.md)|Shows where .NET Objects are allocated and information about garbage collection.|• Optimize .NET memory usage</br>• Analyze garbage collection|
35
35
|[Instrumentation](../profiling/instrumentation-overview.md)|Shows exact call counts and call times.|• You need a tool like CPU Usage, but you want exact call counts and time spent in functions based on wall clock time.</br>• You want to see blocked time, such as time spent waiting for locks.</br>• Note: This tool requires extra overhead.|
36
+
|[.NET Counters](../profiling/dotnet-counters-tool.md)|Live report for .NET counters.|• Begin an investigation for general performance issues.</br>• You want a trace for .NET counter-based metrics such as exceptions per second, garbage collection, and CPU utilization.|
37
+
|[BenchmarkDotNet](../profiling/profiling-with-benchmark-dotnet.md)|Report for benchmarks based on BenchmarkDotNet.|• Get different visualizations of BenchmarkDotNet collected data, such as CPU usage or memory allocations, based on the diagnoser in use.|
36
38
|[File I/O](../profiling/use-file-io.md)|Shows your File I/O operations and how long they take and how much data they process.|Investigate UI freeze|
37
39
|[PerfTips](../profiling/perftips.md)|Shows a quick measurement of performance information while interacting with your code.|While debugging, you want to see the elapsed time between the previous step operation (or breakpoint) to the current step or breakpoint.|
38
40
|[Events viewer](../profiling/events-viewer.md)|Shows HTTP requests, log messages, and exceptions.|• Investigate latency in API calls</br>• Investigate slow application running on a remote web server|
39
41
|[.NET Async](../profiling/analyze-async.md)|Shows async/await usage in .NET apps.|Investigate suspected performance issue with asynchronous code.|
40
-
|[.NET Counters](../profiling/dotnet-counters-tool.md)|Live report for .NET counters.|• Begin an investigation for general performance issues.</br>• You want a trace for .NET counter-based metrics such as exceptions per second, garbage collection, and CPU utilization.|
41
42
|[Database](../profiling/analyze-database.md)|Shows performance of your database queries.|Investigate performance for database queries that use either ADO.NET or Entity Framework Core.|
42
43
|[GPU Usage](./gpu-usage.md)|Shows high-level hardware usage of your Direct3D app.|Check whether the performance of your app is CPU-bound or GPU-bound.|
43
44
|[Application Timeline](../profiling/application-timeline.md)|Shows UI performance for XAML apps.|Investigate UI performance in XAML apps, such as time spent rendering frames.|
@@ -53,11 +54,12 @@ The following table lists the different tools Visual Studio offers and the diffe
This tool is supported for For .NET Core and .NET 5+ apps.
277
+
278
+
## Visualize BenchmarkDotNet data
279
+
280
+
Starting in Visual Studio 2022 version 17.9, you can view data collected using BenchmarkDotNet in the Visual Studio profiling tools. By adding benchmark attributes to your code, you can use specific diagnosers to analyze memory allocations, CPU usage, counters, and other performance data.
281
+
282
+
For more information, see [Analyze BenchmarkDotNet data in Visual Studio](../profiling/profiling-with-benchmark-dotnet.md).
283
+
284
+
:::image type="content" source="../profiling/media/vs-2022/benchmark-dotnet-diagsession.png" alt-text="BenchmarkDotNet data in the profiler.":::
Copy file name to clipboardExpand all lines: docs/profiling/profiling-with-benchmark-dotnet.md
+16-3Lines changed: 16 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,15 +107,28 @@ Each diagnoser generates performance data related to that diagnoser. For example
107
107
Exporteddiagsessionfile:*.diagsession
108
108
```
109
109
110
-
## View Benchmark .NET data
110
+
## View BenchmarkDotNet data
111
111
112
112
1. In Visual Studio, select **File > Open > File** and navigate to the location of the *.diagsession* file, and then select and open the file.
113
113
114
-
1. Select the **Benchmark** tab to view BenchmarkDotNet data.
114
+
1. Select the **Benchmarks** tab to view data for the BenchmarkDotNet benchmarks.
115
115
116
116

117
117
118
-
For more information about the results, see [BenchmarkDotNet](https://benchmarkdotnet.org/articles/overview.html) documentation.
118
+
For more information about the results in the **Benchmarks** tab, see [BenchmarkDotNet](https://benchmarkdotnet.org/articles/overview.html) documentation.
119
+
120
+
1. Right-click a row in the results and choose **Select time range** to sync the timeline graph with the benchmark.
121
+
122
+
1. Select one of the available tabs such as **CPU Usage** or **Allocations**.
123
+
124
+
Depending on the diagnoser you used to collect data, you can gain insights related to memory allocation, CPU usage, counters, and other performance data. To analyze memory allocations, use the built-in [MemoryDiagnoser](https://benchmarkdotnet.org/articles/overview.html#diagnostics) by adding the \[MemoryDiagnoser\] attribute. For more information, see [Diagnosers](https://benchmarkdotnet.org/articles/configs/diagnosers.html).
125
+
126
+
> [!NOTE]
127
+
> The profiler supports only the \[MemoryDiagnoser\] and the diagnosers listed previously in this article.
128
+
129
+
For an example of using the profiler to analyze memory allocations, see the blog post [Benchmarking with Visual Studio Profiler](https://devblogs.microsoft.com/visualstudio/benchmarking-with-visual-studio-profiler/).
130
+
131
+
To analyze data related to other tabs such as **CPU Usage**, see the corresponding articles in the profiling documentation.
0 commit comments