Skip to content

Commit

Permalink
docs: A couple of missing backticks and old style links. (#733)
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys committed Oct 22, 2023
1 parent 34e64ce commit 5408397
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/async_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! Criterion.rs' async benchmarking support.
//!
//! Implementations are provided for:
//! * Tokio (implemented directly for tokio::Runtime)
//! * Tokio (implemented directly for `tokio::Runtime`)
//! * Async-std
//! * Smol
//! * The Futures crate
Expand Down
15 changes: 7 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@ pub fn black_box<T>(dummy: T) -> T {
}
}

/// Argument to [`Bencher::iter_batched`](struct.Bencher.html#method.iter_batched) and
/// [`Bencher::iter_batched_ref`](struct.Bencher.html#method.iter_batched_ref) which controls the
/// Argument to [`Bencher::iter_batched`] and [`Bencher::iter_batched_ref`] which controls the
/// batch size.
///
/// Generally speaking, almost all benchmarks should use `SmallInput`. If the input or the result
Expand All @@ -193,7 +192,7 @@ pub fn black_box<T>(dummy: T) -> T {
///
/// With that said, if the runtime of your function is small relative to the measurement overhead
/// it will be difficult to take accurate measurements. In this situation, the best option is to use
/// [`Bencher::iter`](struct.Bencher.html#method.iter) which has next-to-zero measurement overhead.
/// [`Bencher::iter`] which has next-to-zero measurement overhead.
#[derive(Debug, Eq, PartialEq, Copy, Hash, Clone)]
pub enum BatchSize {
/// `SmallInput` indicates that the input to the benchmark routine (the value returned from
Expand Down Expand Up @@ -258,19 +257,19 @@ impl BatchSize {
}
}

/// Baseline describes how the baseline_directory is handled.
/// Baseline describes how the `baseline_directory` is handled.
#[derive(Debug, Clone, Copy)]
pub enum Baseline {
/// CompareLenient compares against a previous saved version of the baseline.
/// `CompareLenient` compares against a previous saved version of the baseline.
/// If a previous baseline does not exist, the benchmark is run as normal but no comparison occurs.
CompareLenient,
/// CompareStrict compares against a previous saved version of the baseline.
/// `CompareStrict` compares against a previous saved version of the baseline.
/// If a previous baseline does not exist, a panic occurs.
CompareStrict,
/// Save writes the benchmark results to the baseline directory,
/// `Save` writes the benchmark results to the baseline directory,
/// overwriting any results that were previously there.
Save,
/// Discard benchmark results.
/// `Discard` benchmark results.
Discard,
}

Expand Down
12 changes: 5 additions & 7 deletions src/measurement.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! 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 [WallTime](struct.WallTime.html) struct which defines the default wall-clock time
//! measurement.
//! includes the [`WallTime`] struct which defines the default wall-clock time measurement.

use crate::format::short;
use crate::Throughput;
Expand All @@ -14,9 +13,9 @@ use std::time::{Duration, Instant};
/// nanoseconds, the values passed to the formatter will be in nanoseconds).
///
/// Implementors are encouraged to format the values in a way that is intuitive for humans and
/// uses the SI prefix system. For example, the format used by [WallTime](struct.WallTime.html)
/// can display the value in units ranging from picoseconds to seconds depending on the magnitude
/// of the elapsed time in nanoseconds.
/// uses the SI prefix system. For example, the format used by [`WallTime`] can dsiplay the value
/// in units ranging from picoseconds to seconds depending on the magnitude of the elapsed time
/// in nanoseconds.
pub trait ValueFormatter {
/// Format the value (with appropriate unit) and return it as a string.
fn format_value(&self, value: f64) -> String {
Expand Down Expand Up @@ -64,8 +63,7 @@ pub trait ValueFormatter {
}

/// Trait for all types which define something Criterion.rs can measure. The only measurement
/// currently provided is [WallTime](struct.WallTime.html), but third party crates or benchmarks
/// may define more.
/// currently provided is [`WallTime`], but third party crates or benchmarks may define more.
///
/// This trait defines two core methods, `start` and `end`. `start` is called at the beginning of
/// a measurement to produce some intermediate value (for example, the wall-clock time at the start
Expand Down

0 comments on commit 5408397

Please sign in to comment.