[][src]Attribute Macro capsule::bench

#[bench]
This is supported on feature="testils" only.

Procedural macro for running DPDK based benches.

Each bench loop will create a new one-use Mempool with a maximum capacity of 15. The Mempool is not shared with other bench runs, allowing benches to run in isolation and in parallel.

Example

#[capsule::bench(mempool_capcity = 30)]
fn run_benchmark(c: &mut Criterion) {
    c.bench_function("bench:run_benchmark", |b| {
        b.iter(|| bench_thing());
    });
}