Neco.BenchmarkLibrary 0.2.1

dotnet add package Neco.BenchmarkLibrary --version 0.2.1                
NuGet\Install-Package Neco.BenchmarkLibrary -Version 0.2.1                
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="Neco.BenchmarkLibrary" Version="0.2.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Neco.BenchmarkLibrary --version 0.2.1                
#r "nuget: Neco.BenchmarkLibrary, 0.2.1"                
#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.
// Install Neco.BenchmarkLibrary as a Cake Addin
#addin nuget:?package=Neco.BenchmarkLibrary&version=0.2.1

// Install Neco.BenchmarkLibrary as a Cake Tool
#tool nuget:?package=Neco.BenchmarkLibrary&version=0.2.1                

NeCo - Necessary Code - Benchmarks

Nuget (with prereleases) GitHub License

A few helpers around BenchmarkDotNet

Quickstart

using Neco.BenchmarkLibrary;

// Run all benchmarks in an assembly with the default (NetConfig) configuration
BenchmarkStarter.Run(typeof(Program).Assembly);

// Run all benchmarks in an assembly with a specific configuation
// noOverwrite: true to save the benchmark in a '[date]-[time]' directory, instead of the default 'results'
BenchmarkStarter.Run<Net8Net9MigrationConfig>(typeof(Program).Assembly, noOverwrite: true);


// Run a specific benchmarks
BenchmarkStarter.Run<SomeBenchmark>();
BenchmarkStarter.Run<SomeBenchmark, Net8Net9MigrationConfig>();

Quick Performance Estimate

Does not use BenchmarkDotNet, but produces (rough) performance estimates a lot faster (~6 sec per benchmark class). This supports only a very small subset of Benchmark creation features: GlobalSetup, GlobalCleanup, Params

Results are written to the console

using Neco.BenchmarkLibrary;

// Run all benchmarks in an assembly
BenchmarkStarter.QuickBench(typeof(Program).Assembly);

// Run a specific benchmark
BenchmarkStarter.QuickBench<SomeBenchmark>();

// This is almost equivalent to
PerformanceHelper.GetPerformanceRough("SomeBenchmark.Method1", () => new SomeBenchmark().Method());

// Output will look like this
SomeBenchmark.Method1 35,757,090 ops in 5,000.001ms = clean per operation: 0.108µs or 9,298,494.945op/s with 24 Bytes per run and GC 102/0/0
SomeBenchmark.Method1 TotalCPUTime per operation: 4,984.375ms or clean 9,336,433.859op/s for a factor of 0.997

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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
0.2.1 98 12/26/2024
0.2.0 89 12/26/2024
0.1.1 92 12/9/2024
0.1.0 89 12/8/2024