ベンチマーク (BenchmarkDotNet)
Section titled “ベンチマーク (BenchmarkDotNet)”BenchmarkDotNet (ナノベンチマークライブラリ) を使うことで、処理速度やメモリ割当量、GC回数等、詳細で精確なパフォーマンス計測をとることができます。
Visual Studio 2022 (ver 17.9 以降) および Visual Studio 2026 から、標準で「ベンチマークプロジェクト」用のテンプレートが追加され、手軽にパフォーマンス測定や、Visual Studio 上での詳細な解析や最適化ができるようになりました。
GitHub - dotnet/BenchmarkDotNet: Powerful .NET library for benchmarking
Powerful .NET library for benchmarking. Contribute to dotnet/BenchmarkDotNet development by creating an account on GitHub.
https://github.com/dotnet/BenchmarkDotNet

Analyze BenchmarkDotNet data in Visual Studio - Visual Studio (Windows)
Learn how to profile console apps using BenchmarkDotNet.
https://learn.microsoft.com/en-us/visualstudio/profiling/profiling-with-benchmark-dotnet?view=visualstudio
NuGet パッケージの追加
Section titled “NuGet パッケージの追加”$> dotnet add package BenchmarkDotNet