Codebelt.Extensions.BenchmarkDotNet.Console
1.0.0
dotnet add package Codebelt.Extensions.BenchmarkDotNet.Console --version 1.0.0
NuGet\Install-Package Codebelt.Extensions.BenchmarkDotNet.Console -Version 1.0.0
<PackageReference Include="Codebelt.Extensions.BenchmarkDotNet.Console" Version="1.0.0" />
<PackageVersion Include="Codebelt.Extensions.BenchmarkDotNet.Console" Version="1.0.0" />
<PackageReference Include="Codebelt.Extensions.BenchmarkDotNet.Console" />
paket add Codebelt.Extensions.BenchmarkDotNet.Console --version 1.0.0
#r "nuget: Codebelt.Extensions.BenchmarkDotNet.Console, 1.0.0"
#:package Codebelt.Extensions.BenchmarkDotNet.Console@1.0.0
#addin nuget:?package=Codebelt.Extensions.BenchmarkDotNet.Console&version=1.0.0
#tool nuget:?package=Codebelt.Extensions.BenchmarkDotNet.Console&version=1.0.0
Codebelt.Extensions.BenchmarkDotNet.Console
A structured, host-based execution model for running BenchmarkDotNet benchmarks in console applications.
About
Codebelt.Extensions.BenchmarkDotNet.Console extends the Codebelt.Extensions.BenchmarkDotNet package with a dedicated console runner built on the Microsoft Generic Host.
It provides a predictable startup model, consistent dependency injection, and a managed application lifecycle for benchmark execution, aligning benchmarks with the same hosting principles used in modern .NET applications.
By embracing Microsoft.Extensions.Hosting, this package enables clean separation between benchmark definition, configuration, and execution - making benchmarks easier to compose, test, and evolve over time.
At its core, the package favors convention over configuration and promotes benchmarks as first-class, host-managed workloads rather than ad-hoc console routines.
CSharp Example
Benchmarks are executed through a console-hosted Generic Host, allowing full participation in dependency injection, configuration, logging and more.
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Environments;
using BenchmarkDotNet.Jobs;
using Codebelt.Extensions.BenchmarkDotNet.Console;
public class Program
{
public static void Main(string[] args)
{
BenchmarkProgram.Run(args, o =>
{
o.AllowDebugBuild = BenchmarkProgram.IsDebugBuild;
o.ConfigureBenchmarkDotNet(c =>
{
var slimJob = BenchmarkWorkspaceOptions.Slim;
return c.AddJob(slimJob.WithRuntime(CoreRuntime.Core90))
.AddJob(slimJob.WithRuntime(CoreRuntime.Core10_0));
});
});
}
}
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
- Codebelt.Bootstrapper.Console (>= 5.0.1)
- Codebelt.Extensions.BenchmarkDotNet (>= 1.0.0)
-
net9.0
- Codebelt.Bootstrapper.Console (>= 5.0.1)
- Codebelt.Extensions.BenchmarkDotNet (>= 1.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 110 | 12/12/2025 |
Version: 1.0.0
Availability: .NET 10 and .NET 9
# New Features
- ADDED BenchmarkContext class in the Codebelt.Extensions.BenchmarkDotNet.Console namespace that represents the command-line context for a benchmark run
- ADDED BenchmarkProgram class in the Codebelt.Extensions.BenchmarkDotNet.Console namespace that provides the main entry point for hosting and running benchmarks using BenchmarkDotNet
- ADDED BenchmarkWorker class in the Codebelt.Extensions.BenchmarkDotNet.Console namespace that is responsible for executing benchmarks within the console host