Files
bootvine/src/boot_model/boot_projection.rs
T
Willem Vanhulle 552d1170ed perf: rebuild the waiting tree only when the boot changed
The screen keeps the projected tree, milestones and tally and rebuilds them
after boot changes, or every 100 ms so finished units still fade on time.
Release, 200 units, under load: a frame from the cached projection costs
30-40% of a full frame (0.35-0.53 ms against 1.2-1.9 ms).
2026-10-21 13:24:35 +02:00

22 lines
510 B
Rust

use std::time::Duration;
use super::{BootState, MilestoneRow, Tally, TreeNode};
#[derive(Clone, Debug)]
pub struct BootProjection {
pub forest: Vec<TreeNode>,
pub milestones: Vec<MilestoneRow>,
pub tally: Tally,
}
impl BootState {
#[must_use]
pub fn project(&self, finished_since: Duration) -> BootProjection {
BootProjection {
forest: self.waiting_forest(finished_since),
milestones: self.milestones(),
tally: self.tally(),
}
}
}