![]() |
VOOZH | about |
dotnet add package Microsoft.VisualStudio.DiagnosticsHub.BenchmarkDotNetDiagnosers --version 18.7.37220.1
NuGet\Install-Package Microsoft.VisualStudio.DiagnosticsHub.BenchmarkDotNetDiagnosers -Version 18.7.37220.1
<PackageReference Include="Microsoft.VisualStudio.DiagnosticsHub.BenchmarkDotNetDiagnosers" Version="18.7.37220.1" />
<PackageVersion Include="Microsoft.VisualStudio.DiagnosticsHub.BenchmarkDotNetDiagnosers" Version="18.7.37220.1" />Directory.Packages.props
<PackageReference Include="Microsoft.VisualStudio.DiagnosticsHub.BenchmarkDotNetDiagnosers" />Project file
paket add Microsoft.VisualStudio.DiagnosticsHub.BenchmarkDotNetDiagnosers --version 18.7.37220.1
#r "nuget: Microsoft.VisualStudio.DiagnosticsHub.BenchmarkDotNetDiagnosers, 18.7.37220.1"
#:package Microsoft.VisualStudio.DiagnosticsHub.BenchmarkDotNetDiagnosers@18.7.37220.1
#addin nuget:?package=Microsoft.VisualStudio.DiagnosticsHub.BenchmarkDotNetDiagnosers&version=18.7.37220.1Install as a Cake Addin
#tool nuget:?package=Microsoft.VisualStudio.DiagnosticsHub.BenchmarkDotNetDiagnosers&version=18.7.37220.1Install as a Cake Tool
This nuget package allows you to add Diagnosers to your BenchmarkDotNet benchmark functions that allow you to profile your benchmarks using the performance profiling tools in Visual Studio.
You can find more information on BenchmarkDotNet here: https://benchmarkdotnet.org/
And you can find information on BenchmarkDotNet Diagnosers here: https://benchmarkdotnet.org/articles/configs/diagnosers.html?q=diagnoser
In order for the diagnosers in this nuget package to work, you must have Visual Studio 17.9 Preview 1 or newer installed on the machine running the benchmarks. You can also use an equivalent version of the Visual Studio Remote tools - more information on the remote tools can be found here: https://learn.microsoft.com/en-us/visualstudio/debugger/remote-debugging
We currently provide the following diagnosers in this nuget package:
Each diagnoser will generate a .diagsession file that can be opened in Visual Studio that will contain performance data related to that diagnoser (the CPUUsageDiagnoser for example provides a diagsession file with CPU data in it, the DatabaseDiagnoser provides a diagsession file with data on database operations, etc.)
To add a diagnoser to your benchmark, you can add the diagnoser name as an attribute to the class that contains the benchmarks you want to generate diagsessions for. For example, the following class:
[CPUUsageDiagnoser]
public class Md5VsSha256
{
private const int N = 10000;
private readonly byte[] data;
private readonly SHA256 sha256 = SHA256.Create();
private readonly MD5 md5 = MD5.Create();
public Md5VsSha256()
{
data = new byte[N];
new Random(42).NextBytes(data);
}
[Benchmark]
public byte[] Sha256() => sha256.ComputeHash(data);
[Benchmark]
public byte[] Md5() => md5.ComputeHash(data);
}
Will create a diagsession file when run that contains CPU usage data on two benchmark function runs (Sha256 and Md5).
When the BenchmarkDotNet run completes there will be a few lines in the output that states where the diagsession was output to. Using the above for example will provide something like this for the output:
// * Diagnostic Output - VSDiagnosticsDiagnoser * Collection result moved to 'BenchmarkDotNet_Md5VsSha256_20231218_123326.diagsession'. Session : {7f38bcc2-c692-4266-aa24-b12bc5325ea4} Stopped Exported diagsession file: <FullPathToDiagsessionFile>
Where the "Exported diagsession file" will include the full path to the diagsession file that was generated
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 2 NuGet packages that depend on Microsoft.VisualStudio.DiagnosticsHub.BenchmarkDotNetDiagnosers:
| Package | Downloads |
|---|---|
|
Xtate.IoC.Benchmark
State Machine Framework |
|
|
Obsidian.Nbt.Benchmarks
Package Description |
Showing the top 19 popular GitHub repositories that depend on Microsoft.VisualStudio.DiagnosticsHub.BenchmarkDotNetDiagnosers:
| Repository | Stars |
|---|---|
|
SixLabors/ImageSharp
:camera: A modern, cross-platform, 2D Graphics library for .NET
|
|
|
NLog/NLog
NLog - Flexible and Structured Logging for various .NET Platforms
|
|
|
Cysharp/ZLinq
Zero allocation LINQ with LINQ to Span, LINQ to SIMD, and LINQ to Tree (FileSystem, JSON, GameObject, etc.) for all .NET platforms and Unity, Godot.
|
|
|
TheJoeFin/Text-Grab
Use OCR in Windows quickly and easily with Text Grab. With optional background process and notifications.
|
|
|
ExcelDataReader/ExcelDataReader
Lightweight and fast library written in C# for reading Microsoft Excel files
|
|
|
OPCFoundation/UA-.NETStandard
OPC Unified Architecture .NET Standard
|
|
|
tonybaloney/CSnakes
Embed Python in .NET
|
|
|
NickSwardh/YoloDotNet
YoloDotNet - A C# .NET 8.0 project for Classification, Object Detection, OBB Detection, Segmentation and Pose Estimation in both images and live video streams.
|
|
|
IvanJosipovic/KubeUI
Kubernetes User Interface
|
|
|
awgil/ffxiv_bossmod
BossMod FFXIV dalamud plugin
|
|
|
corvus-dotnet/Corvus.JsonSchema
Support for Json Schema validation and entity generation
|
|
|
Kromtec/LegendsViewer-Next
Recreates Dwarf Fortress' Legends Mode from exported files.
|
|
|
salihcantekin/Space
High-performance, source-generator powered mediator and messaging framework for .NET.
|
|
| kuma4649/MDPlayer | |
|
fixfactory/bo2-official-overlays
A collection of SimHub overlays for iRacing made by benofficial2
|
|
|
ssg/SimpleBase
.NET library for encoding/decoding Base16, Base32, Base45, Base58, Base62, Base85, and Multibase.
|
|
|
tossnet/Blazor-Calendar
Yearly, monthly and weekly calendar Blazor Component . For use with .NET 10, 9 and 8 or higher Blazor applications
|
|
|
stride3d/stride-community-toolkit
Collection of helpers and extensions for Stride Game Engine developers. Simplifies and demonstrates common developer tasks building experiences for Stride with .NET.
|
|
|
Cysharp/ToonEncoder
High performance Token-Oriented Object Notation (TOON) encoder for .NET.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 18.7.37220.1 | 51,490 | 4/20/2026 |
| 18.6.37125.3 | 23,244 | 3/26/2026 |
| 18.6.37110.2 | 16,027 | 3/10/2026 |
| 18.3.36812.1 | 96,137 | 12/12/2025 |
| 18.3.36726.2 | 10,316 | 11/27/2025 |
| 18.3.36714.1 | 9,766 | 11/14/2025 |
| 18.0.36525.3 | 68,763 | 9/25/2025 |
| 18.0.36421.1 | 31,969 | 8/22/2025 |
| 18.0.36419.1 | 550 | 8/19/2025 |
| 18.0.36412.2 | 1,048 | 8/13/2025 |
| 18.0.36328.1 | 1,393 | 7/29/2025 |
| 18.0.36313.1 | 12,770 | 7/14/2025 |
| 18.0.36311.3 | 298 | 7/11/2025 |
| 18.0.36302.1 | 10,212 | 7/3/2025 |
| 18.0.36127.1 | 5,355 | 5/28/2025 |
| 17.14.36021.1 | 3,027 | 4/21/2025 |
| 17.13.35606.1 | 16,915 | 12/7/2024 |
| 17.13.35603.1 | 367 | 12/3/2024 |
| 17.13.35505.2 | 1,271 | 11/5/2024 |
| 17.12.35209.2 | 8,335 | 8/12/2024 |