Skip to content
Myr

Also run prepare command during warmup

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

Fixes #182

authored by Stefan Seemayer · committed by David Peter · parent 921f999 · Browse files · 1 file+14 added−13 removed
This commit

State

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

Diff stats

1 file+14 added−13 removed

  • other:+14 added−13 removed

1 file+14 added−13 removed

modified:src/hyperfine/benchmark.rs+14 added-13 removed
203 unmodified lines
204 let mut times_user: Vec<Second> = vec![];205 let mut times_system: Vec<Second> = vec![];206 let mut all_succeeded = true;207208 // Run init command209 let prepare_cmd = options.preparation_command.as_ref().map(|values| {210 let preparation_command = if values.len() == 1 {211 &values[0]212 } else {213 &values[num]214 };215 match cmd.get_parameter() {216 Some((param, value)) => Command::new_parametrized(preparation_command, param, value),217 None => Command::new(preparation_command),218 }219 });220221 // Warmup phase222 if options.warmup_count > 0 {223 let progress_bar = get_progress_bar(224 options.warmup_count,
1 unmodified line
226 options.output_style,227 );228229 for _ in 0..options.warmup_count {230 let _ = run_preparation_command(&options.shell, &prepare_cmd, options.show_output)?;231 let _ = time_shell_command(232 &options.shell,233 cmd,234 options.show_output,
11 unmodified lines
246 "Initial time measurement",247 options.output_style,248 );249236 // Run init command237 let prepare_cmd = options.preparation_command.as_ref().map(|values| {238 let preparation_command = if values.len() == 1 {239 &values[0]240 } else {241 &values[num]242 };243 match cmd.get_parameter() {244 Some((param, value)) => Command::new_parametrized(preparation_command, param, value),245 None => Command::new(preparation_command),246 }247 });248250 let prepare_res = run_preparation_command(&options.shell, &prepare_cmd, options.show_output)?;251252 // Initial timing run253 let (res, success) = time_shell_command(
159 unmodified lines