perf: Fixes (#38935)

Release Notes:

- N/A
This commit is contained in:
Nia
2025-09-26 05:41:06 +00:00
committed by GitHub
parent b1528601cc
commit bcc8149263
3 changed files with 17 additions and 8 deletions
+11 -6
View File
@@ -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();
+4 -1
View File
@@ -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!(