Speed panel: say the time is for one crate's compile, not a whole build

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-28 18:47:40 -07:00
1 parent e3b56cb213
commit 06abc4de80
1 file changed
+6 -6
+6 -6
View File
@@ -20,7 +20,7 @@ pub fn section(ui: &mut Ui, view: &View) {
let rows = [
("Cache fetch (a hit)", timing.avg_hit_read_ms, p.from_cache),
("Cache write", timing.avg_cache_write_ms, p.built),
("Build (compile)", timing.avg_compile_ms, p.muted),
("Compile one crate", timing.avg_compile_ms, p.muted),
];
for (label, ms, color) in rows {
ui.horizontal(|ui| {
@@ -60,9 +60,9 @@ pub fn section(ui: &mut Ui, view: &View) {
let write = timing.avg_cache_write_ms;
let build = timing.avg_compile_ms;
let sentence = if let Some(times) = faster(build, hit) {
format!("A cache hit is about {times}x faster than building.")
format!("A cache hit is about {times}x faster than compiling the crate.")
} else if let Some(times) = faster(build, write) {
format!("Writing to the cache is about {times}x faster than building.")
format!("Writing to the cache is about {times}x faster than compiling the crate.")
} else {
"There are no timings to compare in this range.".to_owned()
};
@@ -87,7 +87,7 @@ fn faster(slower: Option<f64>, faster: Option<f64>) -> Option<String> {
(slower > 0.0 && faster > 0.0).then(|| fmt::round_number(slower / faster))
}
/// "How long builds take, by language": one histogram per language, all on the
/// "How long one crate takes to compile": one histogram per language, all on the
/// same log scale of build time, with the mean, median and p90 marked.
fn build_times(ui: &mut Ui, view: &View) {
let p = theme::ui(ui);
@@ -100,7 +100,7 @@ fn build_times(ui: &mut Ui, view: &View) {
return;
}
ui.add_space(theme::space::BETWEEN_PARTS);
crate::overtime::part_title(ui, "How long builds take, by language");
crate::overtime::part_title(ui, "How long one crate takes to compile");
// One shared axis, from a quarter step before the fastest bin to a quarter step after the slowest.
let (mut low, mut high) = (f64::MAX, 0.0_f64);
@@ -118,7 +118,7 @@ fn build_times(ui: &mut Ui, view: &View) {
ui.horizontal(|ui| {
ui.spacing_mut().item_spacing.x = theme::space::ITEM;
ui.add(egui::Label::new(theme::strong(times.language.clone())).truncate());
ui.add(egui::Label::new(theme::small(ui, format!("{} builds", fmt::count(times.compiles)))).truncate());
ui.add(egui::Label::new(theme::small(ui, format!("{} compiles", fmt::count(times.compiles)))).truncate());
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
ui.spacing_mut().item_spacing.x = theme::space::ITEM;
for (name, value, color) in [