pub struct BenchmarkRunner;Expand description
Runs benchmarks and collects latency data.
Implementations§
Source§impl BenchmarkRunner
impl BenchmarkRunner
Sourcepub fn run<F>(config: &BenchmarkConfig, f: F) -> LatencyReportwhere
F: FnMut(),
pub fn run<F>(config: &BenchmarkConfig, f: F) -> LatencyReportwhere
F: FnMut(),
Run a benchmark with the given configuration and return a latency report.
The closure f is called warmup + iterations times.
Only the last iterations calls are measured.
Sourcepub fn run_with_result<F, R>(config: &BenchmarkConfig, f: F) -> LatencyReportwhere
F: FnMut() -> R,
pub fn run_with_result<F, R>(config: &BenchmarkConfig, f: F) -> LatencyReportwhere
F: FnMut() -> R,
Run a benchmark that returns a value, discarding the return value.
Sourcepub fn run_suite(
suite: Vec<(BenchmarkConfig, Box<dyn FnMut()>)>,
) -> Vec<(String, LatencyReport)>
pub fn run_suite( suite: Vec<(BenchmarkConfig, Box<dyn FnMut()>)>, ) -> Vec<(String, LatencyReport)>
Run multiple named benchmarks and return all reports.
Auto Trait Implementations§
impl Freeze for BenchmarkRunner
impl RefUnwindSafe for BenchmarkRunner
impl Send for BenchmarkRunner
impl Sync for BenchmarkRunner
impl Unpin for BenchmarkRunner
impl UnwindSafe for BenchmarkRunner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).