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 ;
use ProcessorSet;
use ;
// Create a thread pool with two processors.
let two_processors = builder
.take
.expect;
let mut pool = new;
// Shared atomic counter that all threads will increment.
let counter = new;
// Execute 10,000 iterations across all threads.
let stats = new
.iter
.execute_on;
// Get the mean duration for benchmark reporting.
let duration = stats.mean_duration;
See also
More details in the package documentation.
This is part of the Folo project that provides mechanisms for high-performance hardware-aware programming in Rust.