diff options
author | Aria Shrimpton <me@aria.rip> | 2024-02-24 17:06:26 +0000 |
---|---|---|
committer | Aria Shrimpton <me@aria.rip> | 2024-02-24 17:06:26 +0000 |
commit | ba31900cd8cf3f42b4bff28ca8f18849756158c9 (patch) | |
tree | 61477e578a32a171b86df8b82eb5968b5758769c /src/crates | |
parent | 20ddd8922b7842a936fbfa995bb3bb308d7f8653 (diff) |
save each confirmation benchmark as a different baseline
Diffstat (limited to 'src/crates')
-rw-r--r-- | src/crates/candelabra/src/confirmation.rs | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/crates/candelabra/src/confirmation.rs b/src/crates/candelabra/src/confirmation.rs index ad91280..c255628 100644 --- a/src/crates/candelabra/src/confirmation.rs +++ b/src/crates/candelabra/src/confirmation.rs @@ -31,15 +31,26 @@ impl State { self.save_choices(proj, selections) .context("error setting up project")?; - self.run_benchmarks(proj) + self.run_benchmarks(proj, &format!("{:?}", selections).replace("/", "-")) .context("error running benchmarks") } /// Run all benchmarks in the given project, returning their results. /// This can only parse criterion-formatted output - pub fn run_benchmarks(&self, proj: &Project) -> Result<HashMap<String, BenchmarkResult>> { + pub fn run_benchmarks( + &self, + proj: &Project, + baseline_name: &str, + ) -> Result<HashMap<String, BenchmarkResult>> { let child = Command::new("cargo") - .args(["bench"]) + .args([ + "bench", + "--bench", + "main", + "--", + "--save-baseline", + baseline_name, + ]) .current_dir(proj.source_dir.as_std_path()) .stdout(Stdio::piped()) .stderr(if log_enabled!(Level::Debug) { |