AudioSeparator.Benchmark 0.2.0-beta.2

This is a prerelease version of AudioSeparator.Benchmark.
dotnet add package AudioSeparator.Benchmark --version 0.2.0-beta.2
                    
NuGet\Install-Package AudioSeparator.Benchmark -Version 0.2.0-beta.2
                    
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="AudioSeparator.Benchmark" Version="0.2.0-beta.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AudioSeparator.Benchmark" Version="0.2.0-beta.2" />
                    
Directory.Packages.props
<PackageReference Include="AudioSeparator.Benchmark" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AudioSeparator.Benchmark --version 0.2.0-beta.2
                    
#r "nuget: AudioSeparator.Benchmark, 0.2.0-beta.2"
                    
#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.
#:package AudioSeparator.Benchmark@0.2.0-beta.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AudioSeparator.Benchmark&version=0.2.0-beta.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=AudioSeparator.Benchmark&version=0.2.0-beta.2&prerelease
                    
Install as a Cake Tool

AudioSeparator.Benchmark

Benchmark runners and reporters for AudioSeparator — warmup runs, per-phase timing, memory snapshots, and JSON/console reports.

NuGet License: MIT .NET

Part of AudioSeparator — modular .NET audio stem separation.


Install

dotnet add package AudioSeparator.Benchmark

Works with any IAudioSeparator — compose your separator (e.g. Onnx.Demucs + NAudio) separately.


When to use this package

  • You need repeatable performance measurements for stem separation.
  • You want per-phase breakdown: probe, read, inference, assembly, write.
  • You want console tables or JSON reports with RTF and samples/sec.

Quick start

using AudioSeparator.Abstractions.Benchmark;
using AudioSeparator.Benchmark;
using AudioSeparator.NAudio;
using AudioSeparator.Onnx.Demucs;
using Microsoft.ML.OnnxRuntime;

var builder = DemucsBuilder.Create("htdemucs.onnx")
    .UseStemNames("drums", "bass", "other", "vocals")
    .UseNAudio()
    .ConfigureSessionOptions(options =>
    {
        options.GraphOptimizationLevel = GraphOptimizationLevel.ORT_ENABLE_ALL;
        options.AppendExecutionProvider_CUDA(0);
    });

using var separator = builder.Build();

var options = new SeparationBenchmarkOptions
{
    OutputDirectory = "./BenchmarkOutputs",
    WarmupRuns = 1,
    IncludeProbe = true,
    ForceGcBetweenPhases = false
};

var report = await SeparationBenchmarkRunner.RunAsync(
    separator,
    "input.wav",
    options);

ConsoleBenchmarkReporter.Write(report);
// Or: JsonBenchmarkReporter.Write(report);

Benchmark phases

Phase SeparationBenchmarkPhase What is measured
Probe Probe CreateSession (metadata + validation)
Read AudioRead Input decode
Inference Inference Model execution
Assembly ResultAssembly Building SeparationResult
Write StemWrite Optional stem file output

Reports include duration, managed memory, working set, real-time factor (RTF), and samples/sec.


Key API

Type Role
SeparationBenchmarkRunner.RunAsync Warmup + timed run with observer
BenchmarkReportBuilder.Build Builds SeparationBenchmarkReport from phase measurements
ConsoleBenchmarkReporter.Write Formatted phase table to console
JsonBenchmarkReporter.Serialize / Write JSON output (camelCase)
MemorySampler.Capture Managed + working-set snapshot

Benchmark DTOs (SeparationBenchmarkOptions, SeparationBenchmarkReport, PhaseMeasurement, ISeparationBenchmarkObserver) live in AudioSeparator.Abstractions.


Requirements


Package NuGet Description
AudioSeparator.Onnx.Demucs Demucs backend Common benchmark target
AudioSeparator.Abstractions Contracts Benchmark DTOs and observer

Example host: Examples/AudioSeparator.Benchmark

Source: AudioSeparator.Benchmark on GitHub


License

MIT — see AudioSeparator repository.

Product Compatible and additional computed target framework versions.
.NET 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. 
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.0-beta.2 59 9/13/2026
0.2.0-beta.1 58 9/13/2026
0.2.0-beta 77 8/30/2026
0.1.0-beta 81 8/13/2026