Skip to content
Myr

cargo fmt

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by sharkdp · committed by sharkdp · parent 1569334 · Browse files · 5 files+20 added−16 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

5 files+20 added−16 removed

  • other:+20 added−16 removed

5 files+20 added−16 removed

modified:src/hyperfine/export/markdown.rs+2 added-1 removed
32 unmodified lines
33 entry.mean * MULTIPLIER,34 entry.stddev * MULTIPLIER,35 entry.min * MULTIPLIER,36 entry.max * MULTIPLIER37 )37 ).as_bytes(),38 .as_bytes(),39 );40}
modified:src/hyperfine/benchmark.rs+4 added-1 removed
217 unmodified lines
218219 let count = {220 let min = cmp::max(runs_in_min_time, options.runs.min);221222 options.runs.max.as_ref()222 options223 .runs224 .max225 .as_ref()226 .map(|max| cmp::min(min, *max))227 .unwrap_or(min)228 };229
118 unmodified lines
modified:src/hyperfine/internal.rs+5 added-4 removed
69 unmodified lines
70 for item in longer_items {71 let ratio = item.mean / fastest_item.mean;72 // https://en.wikipedia.org/wiki/Propagation_of_uncertainty#Example_formulas73 // Covariance asssumed to be 0, i.e. variables are assumed to be independent74 let ratio_stddev = ratio * ( (item.stddev/item.mean).powi(2) + (fastest_item.stddev/fastest_item.mean).powi(2) ).sqrt();74 let ratio_stddev = ratio75 * ((item.stddev / item.mean).powi(2)76 + (fastest_item.stddev / fastest_item.mean).powi(2))77 .sqrt();78 println!(79 "{} ± {} times faster than '{}'",77 format!("{:8.2}", ratio)78 .bold()79 .green(),80 format!("{:8.2}", ratio).bold().green(),81 format!("{:.2}", ratio_stddev).green(),82 &item.command.magenta()83 );84 }
10 unmodified lines
modified:src/hyperfine/types.rs+1 added-4 removed
82 unmodified lines
83}8485impl Default for Runs {86 fn default() -> Runs {87 Runs {88 min: 10,89 max: None,90 }87 Runs { min: 10, max: None }88 }89}9091/// A set of options for hyperfine
90 unmodified lines
modified:src/main.rs+8 added-6 removed
40 unmodified lines
41mod hyperfine;4243use hyperfine::app::get_arg_matches;44use hyperfine::benchmark::{mean_shell_spawning_time, run_benchmark};45use hyperfine::error::{ParameterScanError, OptionsError};45use hyperfine::error::{OptionsError, ParameterScanError};46use hyperfine::export::{ExportManager, ExportType};47use hyperfine::internal::write_benchmark_comparison;48use hyperfine::types::{49 BenchmarkResult, CmdFailureAction, Command, HyperfineOptions, OutputStyleOption,
117 unmodified lines
167 options.output_style = match matches.value_of("style") {168 Some("full") => OutputStyleOption::Full,169 Some("basic") => OutputStyleOption::Basic,170 Some("nocolor") => OutputStyleOption::NoColor,171 _ => {171 _ => if !options.show_output && atty::is(Stream::Stdout) {172 OutputStyleOption::Full173 } else {174 OutputStyleOption::Basic175 },172 if !options.show_output && atty::is(Stream::Stdout) {173 OutputStyleOption::Full174 } else {175 OutputStyleOption::Basic176 }177 }178 };179180 // We default Windows to NoColor if full had been specified.181 if cfg!(windows) && options.output_style == OutputStyleOption::Full {
53 unmodified lines