@@ -5,7 +5,8 @@ rustflags = ["-C", "symbol-mangling-version=v0", "--cfg", "tokio_unstable"]
[alias]
xtask = "run --package xtask --"
perf-test = ["test", "--profile", "release-fast", "--lib", "--bins", "--tests", "--all-features", "--config", "target.'cfg(true)'.runner='cargo run -p perf --release'", "--config", "target.'cfg(true)'.rustflags=[\"--cfg\", \"perf_enabled\"]"]
-perf-compare = ["run", "--release", "-p", "perf", "--", "compare"]
+# Keep similar flags here to share some ccache
+perf-compare = ["run", "--profile", "release-fast", "-p", "perf", "--config", "target.'cfg(true)'.rustflags=[\"--cfg\", \"perf_enabled\"]", "--", "compare"]
[target.'cfg(target_os = "windows")']
rustflags = [
@@ -261,8 +261,8 @@ impl Output {
// Only compare categories where both meow
// runs have data. /
let mut other_data = other_categories.remove(&cat)?;
- let mut max = 0.;
- let mut min = 0.;
+ let mut max = f64::MIN;
+ let mut min = f64::MAX;
// Running totals for averaging out tests.
let mut r_total_numerator = 0.;
@@ -284,10 +284,15 @@ impl Output {
r_total_numerator += shift * f64::from(weight);
r_total_denominator += u32::from(weight);
}
- let mean = r_total_numerator / f64::from(r_total_denominator);
- // TODO: also aggregate standard deviation? That's harder to keep
- // meaningful, though, since we dk which tests are correlated.
- Some((cat, PerfDelta { max, mean, min }))
+ // There were no runs here!
+ if r_total_denominator == 0 {
+ None
+ } else {
+ let mean = r_total_numerator / f64::from(r_total_denominator);
+ // TODO: also aggregate standard deviation? That's harder to keep
+ // meaningful, though, since we dk which tests are correlated.
+ Some((cat, PerfDelta { max, mean, min }))
+ }
})
.collect();
@@ -93,7 +93,10 @@ impl OutputKind<'_> {
match self {
OutputKind::Markdown => print!("{output}"),
OutputKind::Json(ident) => {
- let wspace_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
+ // We're going to be in tooling/perf/$whatever.
+ let wspace_dir = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap())
+ .join("..")
+ .join("..");
let runs_dir = PathBuf::from(&wspace_dir).join(consts::RUNS_DIR);
std::fs::create_dir_all(&runs_dir).unwrap();
assert!(