Codebelt.Extensions.BenchmarkDotNet 1.0.0

dotnet add package Codebelt.Extensions.BenchmarkDotNet --version 1.0.0
                    
NuGet\Install-Package Codebelt.Extensions.BenchmarkDotNet -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Codebelt.Extensions.BenchmarkDotNet" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Codebelt.Extensions.BenchmarkDotNet" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Codebelt.Extensions.BenchmarkDotNet" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Codebelt.Extensions.BenchmarkDotNet --version 1.0.0
                    
#r "nuget: Codebelt.Extensions.BenchmarkDotNet, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Codebelt.Extensions.BenchmarkDotNet@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Codebelt.Extensions.BenchmarkDotNet&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Codebelt.Extensions.BenchmarkDotNet&version=1.0.0
                    
Install as a Cake Tool

Codebelt.Extensions.BenchmarkDotNet

A unified, opinionated foundation for building robust BenchmarkDotNet workflows in .NET.

About

Codebelt.Extensions.BenchmarkDotNet is part of a modern, MIT-licensed ecosystem designed to bring clarity, structure, and consistency to BenchmarkDotNet projects.

If you value predictable conventions, clean separation of responsibilities, and benchmarks that scale gracefully across .NET 9 and .NET 10, this library is your agile companion.

It removes unnecessary ceremony while embracing best practices from other consumers of BenchmarkDotNet, so you can focus on performance insights, not plumbing.

At its heart, the package is free, flexible, and crafted to extend and empower your agile codebelt.

Folder Structure

The folder structure promoted by Codebelt.Extensions.BenchmarkDotNet follows the same architectural principles commonly used for test projects—while remaining purpose-built for benchmarking.

At the solution level, benchmarks are treated as a first-class concern, clearly separated from tooling and output artifacts.

  • tuning contains all benchmark projects (e.g. *.Benchmarks), in the same way that a test folder typically contains *.Tests projects,
  • tooling hosts the executable console application responsible for discovering and running benchmarks,
  • reports captures benchmark results and generated artifacts, separated from source code and tooling concerns.

This separation enforces a clean boundary between benchmark definition, execution, and output, making benchmark suites easier to scale, automate, and reason about.

Example Layout

Repository Root
│
├─ reports
│  └─ tuning
│     └─ github
│        └─ MyLibrary.ExampleBenchmarks-report-github.md
│
├─ src
│  └─ MyLibrary
│
├─ test
│  └─ MyLibrary.Tests
│     └─ ExampleTest.cs
│
├─ tooling
│  └─ benchmark-runner
│     └─ Program.cs
│
└─ tuning
   └─ MyLibrary.Benchmarks
      └─ ExampleBenchmark.cs

CSharp Example

Benchmarks are executed using a Generic Host–based bootstrap model, allowing BenchmarkDotNet to participate in a fully managed application lifecycle with dependency injection, configuration, and logging.

using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System;

var hostBuilder = Host.CreateDefaultBuilder(args);
hostBuilder.ConfigureServices(services =>
{
    services.AddSingleton(new BenchmarkContext(args));
    services.AddBenchmarkWorkspace(setup);
});
var host = hostBuilder.Build();
host.Run();

The folder structure is based o

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Codebelt.Extensions.BenchmarkDotNet:

Package Downloads
Codebelt.Extensions.BenchmarkDotNet.Console

The Codebelt.Extensions.BenchmarkDotNet.Console namespace contains types that provide a structured and opinionated console-hosted execution model for BenchmarkDotNet.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 92 12/12/2025

Version: 1.0.0
Availability: .NET 10 and .NET 9
# New Features
- ADDED BenchmarkWorkspace class in the Codebelt.Extensions.BenchmarkDotNet namespace that provides a default implementation of IBenchmarkWorkspace for discovering and handling assemblies and their generated artifacts in BenchmarkDotNet
- ADDED BenchmarkWorkspaceOptions class in the Codebelt.Extensions.BenchmarkDotNet namespace that specifies configuration options that is related to the BenchmarkWorkspace class
- ADDED BenchmarkWorkspaceOptionsExtensions class in the Codebelt.Extensions.BenchmarkDotNet namespace that consist of extension methods for the BenchmarkWorkspaceOptions class: ConfigureBenchmarkDotNet
- ADDED IBenchmarkWorkspace interface in the Codebelt.Extensions.BenchmarkDotNet namespace that defines a way for discovering and handling assemblies and their generated artifacts in BenchmarkDotNet
- ADDED ServiceCollectionExtensions class in the Codebelt.Extensions.BenchmarkDotNet namespace that consist of extension methods for the IServiceCollection interface: AddBenchmarkWorkspace and AddBenchmarkWorkspace{TWorkspace}