Expand description
Criterion that counts instructions when MZ_BENCH_MEASUREMENT=instructions.
Benches import from this crate instead of criterion and measure wall time
by default, or the user-space instructions the benchmarking thread retires.
Instruction counts miss other threads and the kernel, so benches that spawn
threads or do I/O stay on plain criterion.
Modules§
- async_
executor - This module defines a trait that can be used to plug in different Futures executors into Criterion.rs’ async benchmarking support.
- measurement
- This module defines a set of traits that can be used to plug different measurements (eg.
Unix’s Processor Time, CPU or GPU performance counters, etc.) into Criterion.rs. It also
includes the
WallTimestruct which defines the default wall-clock time measurement. - profiler
- This module provides an extension trait which allows in-process profilers
to be hooked into the
--profile-timeargument at compile-time. Users of out-of-process profilers such as perf don’t need to do anything special.
Macros§
- criterion_
group - criterion_
main - Macro which expands to a benchmark harness.
Structs§
- Async
Bencher - Async/await variant of
Bencher. - Benchmark
Group - Structure used to group together a set of related benchmarks, along with custom configuration settings for groups of benchmarks. All benchmarks performed using a benchmark group will be grouped together in the final report.
- Benchmark
Id - Simple structure representing an ID for a benchmark. The ID must be unique within a benchmark group.
- Measurement
- Wall time, or with a counter, instruction counts passed off as nanoseconds so that criterion’s wall-time arithmetic applies unchanged.
- Plot
Configuration - Contains the configuration options for the plots generated by a particular benchmark or benchmark group.
Enums§
- Axis
Scale - Axis scaling type. Specified via
PlotConfiguration::summary_scale. - Baseline
- Baseline describes how the
baseline_directoryis handled. - Batch
Size - Argument to
Bencher::iter_batchedandBencher::iter_batched_refwhich controls the batch size. - Benchmark
Filter - Benchmark filtering support.
- Plotting
Backend - Enum used to select the plotting backend.
- Sampling
Mode - This enum allows the user to control how Criterion.rs chooses the iteration count when sampling.
The default is
Auto, which will choose a method automatically based on the iteration time during the warm-up phase. - Throughput
- Enum representing different ways of measuring the throughput of benchmarked code. If the throughput setting is configured for a benchmark then the estimated throughput will be reported as well as the time per iteration.
Functions§
- black_
box Deprecated - A function that is opaque to the optimizer, used to prevent the compiler from optimizing away computations in a benchmark.