Mechanisms for multithreaded benchmarking, designed for integration with Criterion or a similar benchmark framework.
This package provides low-overhead utilities for benchmarking operations across multiple threads, with features like thread pool reuse, flexible configuration, and seamless integration with popular benchmark frameworks.
use black_box;
use Arc;
use ;
use ;
// Create a thread pool.
let pool = default;
// Shared atomic counter that all threads will increment.
let counter = new;
let run = new
.prepare_thread_fn
.prepare_iter_fn
.iter_fn;
// Execute 10,000 iterations across all threads.
let stats = run.execute_on;
// Get the mean duration for benchmark reporting.
let duration = stats.mean_duration;
More details in the package documentation.
This is part of the Folo project that provides mechanisms for high-performance hardware-aware programming in Rust.