Skip to content

Commit 3c0790f

Browse files
committed
Add usage details for BenchmarkDotNet, add links
1 parent c1f6a21 commit 3c0790f

File tree

5 files changed

+25
-6
lines changed

5 files changed

+25
-6
lines changed

docs/profiling/choose-performance-tool.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ The following table lists the different tools Visual Studio offers and provides
3333
|[Memory Usage](../profiling/memory-usage.md)|Shows your app’s memory to find issues such as memory leaks.|&#x2022; Optimize memory usage</br>&#x2022; Investigate UI freeze</br>&#x2022; Investigate suspected memory leak (native code)|
3434
|[.NET Object Allocation](../profiling/dotnet-alloc-tool.md)|Shows where .NET Objects are allocated and information about garbage collection.|&#x2022; Optimize .NET memory usage</br>&#x2022; Analyze garbage collection|
3535
|[Instrumentation](../profiling/instrumentation-overview.md)|Shows exact call counts and call times.|&#x2022; You need a tool like CPU Usage, but you want exact call counts and time spent in functions based on wall clock time.</br>&#x2022; You want to see blocked time, such as time spent waiting for locks.</br>&#x2022; Note: This tool requires extra overhead.|
36+
|[.NET Counters](../profiling/dotnet-counters-tool.md)|Live report for .NET counters.|&#x2022; Begin an investigation for general performance issues.</br>&#x2022; 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.|&#x2022; Compare performance against baseline runs. Helps you to understand the impact of code changes on performance.|
3638
|[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|
3739
|[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.|
3840
|[Events viewer](../profiling/events-viewer.md)|Shows HTTP requests, log messages, and exceptions.|&#x2022; Investigate latency in API calls</br>&#x2022; Investigate slow application running on a remote web server|
3941
|[.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.|&#x2022; Begin an investigation for general performance issues.</br>&#x2022; You want a trace for .NET counter-based metrics such as exceptions per second, garbage collection, and CPU utilization.|
4142
|[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.|
4243
|[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.|
4344
|[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
5354
|[Memory Usage](../profiling/memory-usage.md)|yes|yes|yes|yes|
5455
|[.NET Object Allocation](../profiling/dotnet-alloc-tool.md)|yes|no|yes|yes|
5556
|[Instrumentation](../profiling/instrumentation-overview.md)|yes|yes|yes|yes|
57+
|[.NET Counters](../profiling/dotnet-counters-tool.md)|yes (.NET Core/5+ only)|no|no|yes (ASP.NET Core only)|
58+
|[BenchmarkDotNet](../profiling/profiling-with-benchmark-dotnet.md)|yes|no|no|partial|
5659
|[File I/O](../profiling/use-file-io.md)|yes|yes|yes|yes|
5760
|[PerfTips](../profiling/perftips.md)|yes|yes|yes|yes|
5861
|[Events viewer](../profiling/events-viewer.md)|yes|yes|yes|yes|
5962
|[.NET Async](../profiling/analyze-async.md)|yes|no|yes|yes|
60-
|[.NET Counters](../profiling/dotnet-counters-tool.md)|yes (.NET Core/5+ only)|no|no|yes (ASP.NET Core only)|
6163
|[Database](../profiling/analyze-database.md)|yes (.NET Core/5+ only)|no|no|yes (ASP.NET Core only)|
6264
|[GPU Usage](./gpu-usage.md)|yes|yes|yes|no|
6365
|[Application Timeline](../profiling/application-timeline.md)|yes (XAML)|no|yes|no|
@@ -74,6 +76,7 @@ The following tools are supported with Linux or WSL as the target platform as we
7476
- .NET Object Allocation Tracking
7577
- .NET Async
7678
- .NET Counters
79+
- BenchmarkDotNet
7780
- Events Viewer
7881
- Database
7982

docs/profiling/index.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ landingContent:
6767
url: instrumentation-overview.md
6868
- text: .NET Counters
6969
url: dotnet-counters-tool.md
70+
- text: Benchmark.NET
71+
url: profiling-with-benchmark-dotnet.md
7072
- text: File I/O
7173
url: use-file-io.md
7274
- text: Database
7375
url: analyze-database.md
74-
- text: Benchmark.NET
75-
url: profiling-with-benchmark-dotnet.md
7676
- text: Events Viewer
7777
url: events-viewer.md
7878
- text: .NET Async

docs/profiling/profiling-feature-tour.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,12 @@ The tool shows live values for each counter in a list view.
274274
:::image type="content" source="../profiling/media/dotnet-counters-tool-collecting.png" alt-text=".NET Counter tool collecting.":::
275275

276276
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 measure performance against a baseline run. For more information, see [Analyze BenchmarkDotNet data in Visual Studio](../profiling/profiling-with-benchmark-dotnet.md).
281+
282+
:::image type="content" source="../profiling/media/vs-2022/benchmark-dotnet-diagsession.png" alt-text="BenchmarkDotNet data in the profiler.":::
277283
::: zone-end
278284

279285
## Examine application events

docs/profiling/profiling-with-benchmark-dotnet.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,18 @@ Each diagnoser generates performance data related to that diagnoser. For example
115115

116116
![Screenshot of BenchmarkDotNet data in Visual Studio.](../profiling/media/vs-2022/benchmark-dotnet-diagsession.png)
117117

118+
1. Right-click a row in the results and choose **Select time range** to sync the timeline with the benchmark
119+
118120
For more information about the results, see [BenchmarkDotNet](https://benchmarkdotnet.org/articles/overview.html) documentation.
119121

122+
## Analyze additional data
123+
124+
Depending on the diagnoser you used, you can analyze the collected BenchmarkDotNet data to gain insights related to memory allocation, CPU usage, counters, and other data.
125+
126+
- In the profiler, open one of the tabs such as **CPU Usage** or **Allocations**.
127+
128+
For an example using the memory diagnoser, see the blog post [Benchmarking with Visual Studio Profiler](https://devblogs.microsoft.com/visualstudio/benchmarking-with-visual-studio-profiler/).
129+
120130
## Related content
121131

122132
- [First look at profiling](../profiling/choose-performance-tool.md)

docs/profiling/toc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@
102102
href: instrumentation.md
103103
- name: .NET Counters
104104
href: dotnet-counters-tool.md
105+
- name: BenchmarkDotNet
106+
href: profiling-with-benchmark-dotnet.md
105107
- name: File IO
106108
href: use-file-io.md
107109
- name: PerfTips
@@ -116,8 +118,6 @@
116118
href: application-timeline.md
117119
- name: Add user marks to timeline
118120
href: add-timeline-graph-user-marks.md
119-
- name: BenchmarkDotNet
120-
href: profiling-with-benchmark-dotnet.md
121121
- name: Analyze GPU usage
122122
href: gpu-usage.md
123123
- name: Measure performance from the command-line

0 commit comments

Comments
 (0)