Neco.BenchmarkLibrary
0.1.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Neco.BenchmarkLibrary --version 0.1.0
NuGet\Install-Package Neco.BenchmarkLibrary -Version 0.1.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="Neco.BenchmarkLibrary" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Neco.BenchmarkLibrary --version 0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Neco.BenchmarkLibrary, 0.1.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.
// Install Neco.BenchmarkLibrary as a Cake Addin #addin nuget:?package=Neco.BenchmarkLibrary&version=0.1.0 // Install Neco.BenchmarkLibrary as a Cake Tool #tool nuget:?package=Neco.BenchmarkLibrary&version=0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
NeCo - Necessary Code - Benchmarks
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
SomeBenchmark.Method2 21,123,454 ops in 5,000.001ms = clean per operation: 0.205µs or 4,873,048.375op/s with 24 Bytes per run and GC 60/0/0
SomeBenchmark.Method2 TotalCPUTime per operation: 5,000.000ms or clean 4,873,049.836op/s for a factor of 1.000
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. 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.
-
net8.0
- BenchmarkDotNet (>= 0.14.0)
- BenchmarkDotNet.Diagnostics.Windows (>= 0.14.0)
- Neco.Common (>= 0.1.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.