#[bench]Expand description
Register a benchmark function
§Example
ⓘ
#[flux::bench]
fn my_benchmark(b: &mut Bencher) {
b.iter(|| expensive_operation());
}
// With configuration
#[flux::bench(
id = "custom_id",
group = "parsing",
severity = "critical",
threshold = 5.0,
budget = "100ms"
)]
fn critical_benchmark(b: &mut Bencher) { ... }
// Async with multi-threaded runtime
#[flux::bench(runtime = "multi_thread", worker_threads = 4)]
async fn async_benchmark(b: &mut Bencher) { ... }