Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 88ae8fc

Browse files
committed
Allow passing more than two commands to benchmark to hyperfine_command
1 parent d2a8023 commit 88ae8fc

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

build_system/bench.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ fn benchmark_simple_raytracer(dirs: &Dirs, bootstrap_host_compiler: &Compiler) {
8080
);
8181

8282
let bench_compile =
83-
hyperfine_command(1, bench_runs, Some(&clean_cmd), &llvm_build_cmd, &clif_build_cmd);
83+
hyperfine_command(1, bench_runs, Some(&clean_cmd), &[&llvm_build_cmd, &clif_build_cmd]);
8484

8585
spawn_and_wait(bench_compile);
8686

@@ -95,8 +95,10 @@ fn benchmark_simple_raytracer(dirs: &Dirs, bootstrap_host_compiler: &Compiler) {
9595
0,
9696
bench_runs,
9797
None,
98-
Path::new(".").join(get_file_name("raytracer_cg_llvm", "bin")).to_str().unwrap(),
99-
Path::new(".").join(get_file_name("raytracer_cg_clif", "bin")).to_str().unwrap(),
98+
&[
99+
Path::new(".").join(get_file_name("raytracer_cg_llvm", "bin")).to_str().unwrap(),
100+
Path::new(".").join(get_file_name("raytracer_cg_clif", "bin")).to_str().unwrap(),
101+
],
100102
);
101103
bench_run.current_dir(RelPath::BUILD.to_path(dirs));
102104
spawn_and_wait(bench_run);

build_system/utils.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,7 @@ pub(crate) fn hyperfine_command(
162162
warmup: u64,
163163
runs: u64,
164164
prepare: Option<&str>,
165-
a: &str,
166-
b: &str,
165+
cmds: &[&str],
167166
) -> Command {
168167
let mut bench = Command::new("hyperfine");
169168

@@ -179,7 +178,7 @@ pub(crate) fn hyperfine_command(
179178
bench.arg("--prepare").arg(prepare);
180179
}
181180

182-
bench.arg(a).arg(b);
181+
bench.args(cmds);
183182

184183
bench
185184
}

0 commit comments

Comments
 (0)