1
Fork 0

Allow passing more than two commands to benchmark to hyperfine_command

This commit is contained in:
bjorn3 2023-02-11 13:13:38 +00:00
parent d2a8023948
commit 88ae8fc9c8
2 changed files with 7 additions and 6 deletions

View file

@ -80,7 +80,7 @@ fn benchmark_simple_raytracer(dirs: &Dirs, bootstrap_host_compiler: &Compiler) {
); );
let bench_compile = let bench_compile =
hyperfine_command(1, bench_runs, Some(&clean_cmd), &llvm_build_cmd, &clif_build_cmd); hyperfine_command(1, bench_runs, Some(&clean_cmd), &[&llvm_build_cmd, &clif_build_cmd]);
spawn_and_wait(bench_compile); spawn_and_wait(bench_compile);
@ -95,8 +95,10 @@ fn benchmark_simple_raytracer(dirs: &Dirs, bootstrap_host_compiler: &Compiler) {
0, 0,
bench_runs, bench_runs,
None, None,
Path::new(".").join(get_file_name("raytracer_cg_llvm", "bin")).to_str().unwrap(), &[
Path::new(".").join(get_file_name("raytracer_cg_clif", "bin")).to_str().unwrap(), Path::new(".").join(get_file_name("raytracer_cg_llvm", "bin")).to_str().unwrap(),
Path::new(".").join(get_file_name("raytracer_cg_clif", "bin")).to_str().unwrap(),
],
); );
bench_run.current_dir(RelPath::BUILD.to_path(dirs)); bench_run.current_dir(RelPath::BUILD.to_path(dirs));
spawn_and_wait(bench_run); spawn_and_wait(bench_run);

View file

@ -162,8 +162,7 @@ pub(crate) fn hyperfine_command(
warmup: u64, warmup: u64,
runs: u64, runs: u64,
prepare: Option<&str>, prepare: Option<&str>,
a: &str, cmds: &[&str],
b: &str,
) -> Command { ) -> Command {
let mut bench = Command::new("hyperfine"); let mut bench = Command::new("hyperfine");
@ -179,7 +178,7 @@ pub(crate) fn hyperfine_command(
bench.arg("--prepare").arg(prepare); bench.arg("--prepare").arg(prepare);
} }
bench.arg(a).arg(b); bench.args(cmds);
bench bench
} }