Expand description
§FluxBench
Benchmarking framework for Rust with crash isolation, statistical rigor, and CI integration.
FluxBench provides a next-generation benchmarking platform:
- Process Isolation: Crash-resilient “Fail-Late” architecture; panicking benchmarks don’t crash the suite
- Zero-Copy IPC: Efficient supervisor-worker communication using rkyv serialization
- Statistical Rigor: Bootstrap resampling with BCa (bias-corrected and accelerated) confidence intervals
- CI Integration: Severity levels (critical/warning/info), GitHub Actions summaries, baseline comparison
- Algebraic Verification: Performance assertions directly in code with mathematical expressions
- Synthetic Metrics: Compute derived metrics from benchmark results
- Multi-Way Comparisons: Generate comparison tables and series charts
- Allocation Tracking:
TrackingAllocatormeasures heap usage per iteration - High-Precision Timing: RDTSC cycle counting on x86_64 with Instant fallback
§Quick Start
ⓘ
use fluxbench::prelude::*;
#[flux::bench]
fn my_benchmark(b: &mut Bencher) {
b.iter(|| {
// Code to benchmark
expensive_operation()
});
}§Async Benchmarks
ⓘ
#[flux::bench(runtime = "multi_thread", worker_threads = 4)]
async fn async_benchmark(b: &mut Bencher) {
b.iter(|| async {
tokio::time::sleep(Duration::from_millis(1)).await;
});
}§Performance Assertions
ⓘ
#[flux::verify(expr = "(raw - overhead) < 50000000", severity = "critical")]
struct NetTimeCheck;Modules§
Structs§
- Bencher
- The Bencher provides iteration control for benchmarks.
- Benchmark
Def - Benchmark definition registered via
#[flux::bench] - Benchmark
Result - Result of a single benchmark run
- Bootstrap
Config - Bootstrap configuration
- Bootstrap
Result - Result of bootstrap analysis
- Chart
Def - Chart definition for dashboard
- Compare
Def - Comparison group - groups multiple benchmarks for side-by-side comparison
- Group
Def - Group definition for organizing benchmarks
- Metric
Context - Context holding benchmark metrics for expression evaluation
- Report
Def - Report/dashboard definition
- Summary
Statistics - Comprehensive summary statistics
- Synthetic
Def - Definition of a synthetic metric registered via
#[flux::synthetic] - Tracking
Allocator - Tracking allocator that wraps the system allocator
- Verification
- Verification definition
- Verification
Result - Result of a verification check
- Verify
Def - Definition of a verification rule registered via
#[flux::verify]
Enums§
- Chart
Type - Chart type for dashboard layout
- Iteration
Mode - Mode of iteration for the benchmark
- Severity
- Severity levels for CI integration
- Verification
Status - Verification execution status with explicit states for all outcomes.
Functions§
- compute_
bootstrap - Compute bootstrap confidence interval for the mean
- compute_
summary - Compute summary statistics with proper separation of cleaned vs raw data
- current_
allocation - Get current allocation statistics
- reset_
allocation_ counter - Reset allocation counters (call before each iteration)
- run
- Run the FluxBench CLI harness.