perf: Fixup ordering, fix pathing, docs (#38970)

Release Notes:

- N/A
This commit is contained in:
Nia
2025-09-26 15:28:48 +00:00
committed by GitHub
parent c69912c76a
commit 30b49cfbf5
6 changed files with 35 additions and 20 deletions
+3 -1
View File
@@ -1,5 +1,7 @@
//! Some constants and datatypes used in the Zed perf profiler. Should only be
//! consumed by the crate providing the matching macros.
//!
//! For usage documentation, see the docs on this crate's binary.
use collections::HashMap;
use serde::{Deserialize, Serialize};
@@ -274,7 +276,7 @@ impl Output {
continue;
};
let shift =
(s_timings.iters_per_sec(s_iters) / o_timings.iters_per_sec(o_iters)) - 1.;
(o_timings.iters_per_sec(o_iters) / s_timings.iters_per_sec(s_iters)) - 1.;
if shift > max {
max = shift;
}
+4 -1
View File
@@ -218,7 +218,10 @@ fn compare_profiles(args: &[String]) {
let ident_new = args.first().expect("FATAL: missing identifier for new run");
let ident_old = args.get(1).expect("FATAL: missing identifier for old run");
let wspace_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
let runs_dir = PathBuf::from(&wspace_dir).join(consts::RUNS_DIR);
let runs_dir = PathBuf::from(&wspace_dir)
.join("..")
.join("..")
.join(consts::RUNS_DIR);
// Use the blank outputs initially, so we can merge into these with prefixes.
let mut outputs_new = Output::blank();