Skip to content
Myr

Updates for 0.4.0

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

authored by sharkdp · committed by David Peter · parent 2e24ff0 · Browse files · 7 files+24 added−23 removed
This commit

State

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

Diff stats

7 files+24 added−23 removed

  • other:+24 added−23 removed

7 files+24 added−23 removed

modified:src/hyperfine/benchmark.rs+1 added-1 removed
127 unmodified lines
128/// Run the command specified by `--prepare`.129fn run_preparation_command(command: &Option<String>) -> io::Result<()> {130 if let &Some(ref preparation_command) = command {131 let res = time_shell_command(preparation_command, CmdFailureAction::RaiseError, None);132 if let Err(_) = res {132 if res.is_err() {133 return Err(io::Error::new(134 io::ErrorKind::Other,135 "The preparation command terminated with a non-zero exit code. \136 Append ' || true' to the command if you are sure that this can be ignored.",
170 unmodified lines
modified:src/hyperfine/internal.rs+8 added-8 removed
60 unmodified lines
61}6263/// Return a pre-configured progress bar64pub fn get_progress_bar(length: u64, msg: &str, option: &OutputStyleOption) -> ProgressBar {65 let progressbar_style = match option {66 &OutputStyleOption::Basic => ProgressStyle::default_bar(),67 &OutputStyleOption::Full => ProgressStyle::default_spinner()68 .tick_chars("⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏")69 .template(" {spinner} {msg:<30} {wide_bar} ETA {eta_precise}"),65 let progressbar_style = match *option {66 OutputStyleOption::Basic => ProgressStyle::default_bar(),67 OutputStyleOption::Full => ProgressStyle::default_spinner()68 .tick_chars("⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏")69 .template(" {spinner} {msg:<30} {wide_bar} ETA {eta_precise}"),70 };7172 let progress_bar = match option {73 &OutputStyleOption::Basic => ProgressBar::hidden(),74 &OutputStyleOption::Full => ProgressBar::new(length),72 let progress_bar = match *option {73 OutputStyleOption::Basic => ProgressBar::hidden(),74 OutputStyleOption::Full => ProgressBar::new(length),75 };76 progress_bar.set_style(progressbar_style.clone());77 progress_bar.enable_steady_tick(80);78 progress_bar.set_message(msg);
26 unmodified lines
modified:src/hyperfine/outlier_detection.rs+4 added-4 removed
11 unmodified lines
12/// of standard deviations.13pub const OUTLIER_THRESHOLD: f64 = 1.4826 * 10.0;1415/// Compute modifized Z-scores for a given sample. A (unmodified) Z-score is defined by16/// (x_i - x_mean)/x_stddev whereas the modified Z-score is defined by |x_i - x_median|/MAD where17/// MAD is the median average deviation.16/// `(x_i - x_mean)/x_stddev` whereas the modified Z-score is defined by `|x_i - x_median|/MAD`17/// where MAD is the median average deviation.18///19/// References:20/// - https://en.wikipedia.org/wiki/Median_absolute_deviation20/// - <https://en.wikipedia.org/wiki/Median_absolute_deviation>21pub fn modified_zscores(xs: &[f64]) -> Vec<f64> {22 assert!(!xs.is_empty());2324 // Compute sample median:25 let x_median = median(&xs);25 let x_median = median(xs);2627 // Compute the absolute deviations from the median:28 let deviations: Vec<f64> = xs.iter().map(|x| (x - x_median).abs()).collect();29
73 unmodified lines
modified:src/main.rs+3 added-3 removed
105 unmodified lines
106 .takes_value(true)107 .value_name("TYPE")108 .possible_values(&["auto", "basic", "full"])109 .help(110 "Set output style type. If set to 'basic', all colors and special \111 formatting will be disabled. If set to 'auto' when output target is not \112 a TTY, 'basic' is used (default: auto).",110 "Set output style type (default: auto). Set this to 'basic' to disable output \111 coloring and interactive elements. Set it to 'full' to enable all effects \112 even if no interactive terminal was detected.",113 ),114 )115 .arg(116 Arg::with_name("ignore-failure")
46 unmodified lines
modified:Cargo.lock+4 added-4 removed
93 unmodified lines
94source = "registry+https://github.com/rust-lang/crates.io-index"9596[[package]]97name = "hyperfine"98version = "0.3.0"98version = "0.4.0"99dependencies = [100 "approx 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",101 "atty 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",102 "clap 2.29.2 (registry+https://github.com/rust-lang/crates.io-index)",
54 unmodified lines
157 "num-bigint 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)",158 "num-complex 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)",159 "num-integer 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",160 "num-iter 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",161 "num-rational 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",161 "num-rational 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)",162 "num-traits 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",163]164165[[package]]
34 unmodified lines
200]201202[[package]]203name = "num-rational"204version = "0.1.40"204version = "0.1.41"205source = "registry+https://github.com/rust-lang/crates.io-index"206dependencies = [207 "num-bigint 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)",208 "num-integer 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
222 unmodified lines
431"checksum num-bigint 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "bdc1494b5912f088f260b775799468d9b9209ac60885d8186a547a0476289e23"432"checksum num-complex 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "58de7b4bf7cf5dbecb635a5797d489864eadd03b107930cbccf9e0fd7428b47c"433"checksum num-integer 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "d1452e8b06e448a07f0e6ebb0bb1d92b8890eea63288c0b627331d53514d0fba"434"checksum num-iter 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)" = "7485fcc84f85b4ecd0ea527b14189281cf27d60e583ae65ebc9c088b13dffe01"435"checksum num-rational 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "0c7cb72a95250d8a370105c828f388932373e0e94414919891a0f945222310fe"435"checksum num-rational 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "0b950f75e042fdd710460084d19c8efdcd72d65183ead8ecd04b90483f5a55d2"436"checksum num-traits 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "9936036cc70fe4a8b2d338ab665900323290efb03983c86cbe235ae800ad8017"437"checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37"438"checksum parking_lot 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3e7f7c9857874e54afeb950eebeae662b1e51a2493666d2ea4c0a5d91dcf0412"439"checksum parking_lot_core 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "9f35048d735bb93dd115a0030498785971aab3234d311fbe273d020084d26bd8"
24 unmodified lines
modified:Cargo.toml+1 added-1 removed
modified:README.md+3 added-2 removed