euv-performance 0.47.0

Reproducible CPU, layout, rasterization, and allocation benchmarks for the cross-platform euv runtime.
Documentation
use super::*;

/// Per-stage cold-start Time-To-First-Frame (TTFF) latency breakdown in milliseconds.
#[derive(Clone, Copy, Debug, Default, Deserialize, Getter, PartialEq, Serialize)]
pub struct ColdStartTtffStages {
    /// Stage 1 (`t0 -> t1`): `App` + `Renderer` + surface initialization duration in milliseconds.
    #[get(type(copy))]
    pub(crate) app_renderer_init_ms: f64,
    /// Stage 2 (`t1 -> t2`): System font bind and initial default glyph readiness duration in milliseconds.
    #[get(type(copy))]
    pub(crate) font_ready_ms: f64,
    /// Stage 3 (`t2 -> t3`): Initial showcase shell `SceneTree` mount duration in milliseconds.
    #[get(type(copy))]
    pub(crate) initial_mount_ms: f64,
    /// Stage 4 (`t3 -> t4`): First `LayoutEngine::compute` pass duration in milliseconds.
    #[get(type(copy))]
    pub(crate) first_layout_ms: f64,
    /// Stage 5 (`t4 -> t5`): First `PaintPass::build` display-list compilation duration in milliseconds.
    #[get(type(copy))]
    pub(crate) first_paint_ms: f64,
    /// Stage 6 (`t5 -> t6`): First frame rasterization and presentation duration in milliseconds.
    #[get(type(copy))]
    pub(crate) first_present_ms: f64,
    /// Cumulative elapsed milliseconds from `t0` boot to interactive mount ready (`t3 - t0`).
    #[get(type(copy))]
    pub(crate) ready_ms: f64,
    /// Total elapsed milliseconds from `t0` boot to verified first presented frame (`t6 - t0`).
    #[get(type(copy))]
    pub(crate) total_ttff_ms: f64,
    /// Number of scene nodes laid out during the first layout pass.
    #[get(type(copy))]
    pub(crate) layout_nodes: usize,
    /// Number of display-list draw commands emitted during the first paint pass.
    #[get(type(copy))]
    pub(crate) paint_commands: usize,
    /// Number of render draw batches executed for the first presented frame.
    #[get(type(copy))]
    pub(crate) draw_batches: usize,
    /// Total heap allocation count executed across the full cold-start boot sequence.
    #[get(type(copy))]
    pub(crate) alloc_count: u64,
    /// Total heap bytes allocated across the full cold-start boot sequence.
    #[get(type(copy))]
    pub(crate) bytes_allocated: u64,
}

/// Aggregated multi-run cold-start TTFF benchmark report with per-stage medians and tail totals.
#[derive(Clone, Debug, Default, Deserialize, Getter, New, PartialEq, Serialize)]
pub struct ColdStartTtffReport {
    /// Number of independent cold-start iterations executed.
    #[get(type(copy))]
    pub(crate) iterations: usize,
    /// Element-wise median per-stage breakdown across all cold-start runs.
    #[get(type(copy))]
    pub(crate) median: ColdStartTtffStages,
    /// 95th percentile total TTFF latency in milliseconds.
    #[get(type(copy))]
    pub(crate) p95_total_ttff_ms: f64,
    /// Maximum observed total TTFF latency in milliseconds.
    #[get(type(copy))]
    pub(crate) max_total_ttff_ms: f64,
    /// Raw per-iteration stage measurements.
    pub(crate) runs: Vec<ColdStartTtffStages>,
}