Atmoos.Sphere.BenchmarkDotNet
0.1.5
dotnet add package Atmoos.Sphere.BenchmarkDotNet --version 0.1.5
NuGet\Install-Package Atmoos.Sphere.BenchmarkDotNet -Version 0.1.5
<PackageReference Include="Atmoos.Sphere.BenchmarkDotNet" Version="0.1.5" />
paket add Atmoos.Sphere.BenchmarkDotNet --version 0.1.5
#r "nuget: Atmoos.Sphere.BenchmarkDotNet, 0.1.5"
// Install Atmoos.Sphere.BenchmarkDotNet as a Cake Addin #addin nuget:?package=Atmoos.Sphere.BenchmarkDotNet&version=0.1.5 // Install Atmoos.Sphere.BenchmarkDotNet as a Cake Tool #tool nuget:?package=Atmoos.Sphere.BenchmarkDotNet&version=0.1.5
Atmoos.Sphere.BenchmarkDotNet
Exports benchmark results into the defining benchmark source files.
Summary
This library exports your benchmark results into the corresponding benchmark source files, which can be useful to keep track of the benchmarking results as work on the project progresses.
One scenario is to run all benchmarks before a release or major PR. Improvements and regressions will become visible in the diff.
For examples of this use case please see: Atmoos.Sphere.Benchmark, where this library is used.
Preparing Benchmark Source Files
To mark the location into which the results should be inserted in your benchmark source files, simply add a /* Summary
start and Summary */
end tag.
For example like so in MyBenchmark.cs
:
public class MyBenchmark
{
// Your benchmarks go here...
}
/* Summary
Summary */
The benchmark report will be inserted in-between those two tags.
Example Program.cs File
A simple Program.cs file might look something like this:
using BenchmarkDotNet.Running;
using Atmoos.Sphere.BenchmarkDotNet;
var assembly = typeof(Program).Assembly;
var summary = BenchmarkSwitcher.FromAssembly(assembly).Run(args);
await assembly.Export(summary); // this exports your results
Configuration
The Export
extension method has an overload which takes an ExportConfig
instance with which the export can be configured. This includes custom start and end tags.
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. |
-
net8.0
- Atmoos.Sphere (>= 0.3.5)
- BenchmarkDotNet (>= 0.14.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Please see: https://github.com/atmoos/Sphere/releases