warnings.rs
This file
Path
src/output/warnings.rs
65 lines · 3.4 KiB · Rust
Last changed by
Alternative performance metrics in the terminal (#986)David Peterbefore adoptionbdbfae9
History of this fileTake it
The walk stopped after 200 commits: lines older than 0f91d0c point at it.
Bump serde from 1.0.174 to 1.0.179dependabot[bot]before adoption0f91d0c
lines 1–3why, one step back1use std::fmt;23use crate::benchmark::MIN_EXECUTION_TIME;Alternative performance metrics in the terminal (#986)David Peterbefore adoptionbdbfae9
lines 4–5why, one step back4use crate::metric::{Metric, MetricSelection};5use crate::quantity::millisecond;Bump serde from 1.0.174 to 1.0.179dependabot[bot]before adoption0f91d0c
lines 6–15why, one step back67pub struct OutlierWarningOptions {8 pub warmup_in_use: bool,9 pub prepare_in_use: bool,10}1112/// A list of all possible warnings13pub enum Warnings {14 FastExecutionTime,15 NonZeroExitCode,Alternative performance metrics in the terminal (#986)David Peterbefore adoptionbdbfae9
line 16why, one step back16 InitialRunOutlier(MetricSelection, f64, OutlierWarningOptions),Bump serde from 1.0.174 to 1.0.179dependabot[bot]before adoption0f91d0c
lines 17–23why, one step back17}1819impl fmt::Display for Warnings {20 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {21 match *self {22 Warnings::FastExecutionTime => write!(23 f,Alternative performance metrics in the terminal (#986)David Peterbefore adoptionbdbfae9
line 24why, one step back24 "Command took less than {} ms to complete. Note that the wall-clock measurements might be \Bump serde from 1.0.174 to 1.0.179dependabot[bot]before adoption0f91d0c
lines 25–27why, one step back25 inaccurate because hyperfine can not calibrate the shell startup time much \26 more precise than this limit. You can try to use the `-N`/`--shell=none` \27 option to disable the shell completely.",Alternative performance metrics in the terminal (#986)David Peterbefore adoptionbdbfae9
line 28why, one step back28 MIN_EXECUTION_TIME.get::<millisecond>()Bump serde from 1.0.174 to 1.0.179dependabot[bot]before adoption0f91d0c
lines 29–30why, one step back29 ),30 Warnings::NonZeroExitCode => write!(f, "Ignoring non-zero exit code."),Alternative performance metrics in the terminal (#986)David Peterbefore adoptionbdbfae9
line 31why, one step back31 Warnings::InitialRunOutlier(selection, value, _) if selection.metric != Metric::TimeWallClock => write!(Bump serde from 1.0.174 to 1.0.179dependabot[bot]before adoption0f91d0c
line 32why, one step back32 f,Alternative performance metrics in the terminal (#986)David Peterbefore adoptionbdbfae9
lines 33–38why, one step back33 "The first benchmarking run for this command had an unusually high value for the primary '{}' metric ({}) compared with the rest.",34 selection.metric.name(),35 selection.display_unit(value).format(value),36 ),37 Warnings::InitialRunOutlier(selection, value, ref options) => write!(38 f,Bump serde from 1.0.174 to 1.0.179dependabot[bot]before adoption0f91d0c
lines 39–41why, one step back39 "The first benchmarking run for this command was significantly slower than the \40 rest ({time}). This could be caused by (filesystem) caches that were not filled until \41 after the first run. {hints}",Alternative performance metrics in the terminal (#986)David Peterbefore adoptionbdbfae9
line 42why, one step back42 time=selection.display_unit(value).format(value),Bump serde from 1.0.174 to 1.0.179dependabot[bot]before adoption0f91d0c
lines 43–61why, one step back43 hints=match (options.warmup_in_use, options.prepare_in_use) {44 (true, true) => "You are already using both the '--warmup' option as well \45 as the '--prepare' option. Consider re-running the benchmark on a quiet system. \46 Maybe it was a random outlier. Alternatively, consider increasing the warmup \47 count.",48 (true, false) => "You are already using the '--warmup' option which helps \49 to fill these caches before the actual benchmark. You can either try to \50 increase the warmup count further or re-run this benchmark on a quiet system \51 in case it was a random outlier. Alternatively, consider using the '--prepare' \52 option to clear the caches before each timing run.",53 (false, true) => "You are already using the '--prepare' option which can \54 be used to clear caches. If you did not use a cache-clearing command with \55 '--prepare', you can either try that or consider using the '--warmup' option \56 to fill those caches before the actual benchmark.",57 (false, false) => "You should consider using the '--warmup' option to fill \58 those caches before the actual benchmark. Alternatively, use the '--prepare' \59 option to clear the caches before each timing run."60 }61 ),Alternative performance metrics in the terminal (#986)David Peterbefore adoptionbdbfae9
line 62why, one step back62Bump serde from 1.0.174 to 1.0.179dependabot[bot]before adoption0f91d0c
lines 63–65why, one step back63 }64 }65}