Skip to content
Myr

Export intermediate results after each benchmark command

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

authored by Martin Junghanns · committed by David Peter · parent 4fa1685 · Browse files · 2 files+10 added−10 removed
This commit

State

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

Diff stats

2 files+10 added−10 removed

  • other:+10 added−10 removed

2 files+10 added−10 removed

modified:src/hyperfine/export/mod.rs+1 added-1 removed
67 unmodified lines
68 });69 }7071 /// Write the given results to all Exporters contained within this manager72 pub fn write_results(&self, results: Vec<BenchmarkResult>, unit: Option<Unit>) -> Result<()> {72 pub fn write_results(&self, results: &[BenchmarkResult], unit: Option<Unit>) -> Result<()> {73 for e in &self.exporters {74 let file_content = e.exporter.serialize(&results, unit)?;75 write_to_file(&e.filename, &file_content)?;76 }
9 unmodified lines
modified:src/main.rs+9 added-9 removed
47 unmodified lines
4849 // Run the benchmarks50 for (num, cmd) in commands.iter().enumerate() {51 timing_results.push(run_benchmark(num, cmd, shell_spawning_time, options)?);5253 // Export (intermediate) results54 let ans = export_manager.write_results(&timing_results, options.time_unit);55 if let Err(e) = ans {56 error(&format!(57 "The following error occurred while exporting: {}",58 e59 ));60 }61 }6263 // Print relative speed comparison64 if options.output_style != OutputStyleOption::Disabled {65 write_benchmark_comparison(&timing_results);66 }6759 // Export results60 let ans = export_manager.write_results(timing_results, options.time_unit);61 if let Err(e) = ans {62 error(&format!(63 "The following error occurred while exporting: {}",64 e65 ));66 }6768 Ok(())69}7071fn main() {
269 unmodified lines