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
<PackageReference Include="Codebelt.Extensions.BenchmarkDotNet" Version="1.0.0" />
<PackageVersion Include="Codebelt.Extensions.BenchmarkDotNet" Version="1.0.0" />
<PackageReference Include="Codebelt.Extensions.BenchmarkDotNet" />
paket add Codebelt.Extensions.BenchmarkDotNet --version 1.0.0
#r "nuget: Codebelt.Extensions.BenchmarkDotNet, 1.0.0"
#:package Codebelt.Extensions.BenchmarkDotNet@1.0.0
#addin nuget:?package=Codebelt.Extensions.BenchmarkDotNet&version=1.0.0
#tool nuget:?package=Codebelt.Extensions.BenchmarkDotNet&version=1.0.0
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 atestfolder typically contains*.Testsprojects, - 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
Related Packages
| Product | Versions 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. |
-
net10.0
- BenchmarkDotNet (>= 0.15.8)
- Cuemon.Core (>= 10.1.0)
-
net9.0
- BenchmarkDotNet (>= 0.15.8)
- Cuemon.Core (>= 10.1.0)
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}