aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAria Shrimpton <me@aria.rip>2024-02-24 17:06:26 +0000
committerAria Shrimpton <me@aria.rip>2024-02-24 17:06:26 +0000
commitba31900cd8cf3f42b4bff28ca8f18849756158c9 (patch)
tree61477e578a32a171b86df8b82eb5968b5758769c /src
parent20ddd8922b7842a936fbfa995bb3bb308d7f8653 (diff)
save each confirmation benchmark as a different baseline
Diffstat (limited to 'src')
-rw-r--r--src/crates/candelabra/src/confirmation.rs17
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) {