Skip to main content

CompileSpans

Struct CompileSpans 

Source
pub struct CompileSpans {
    pub validate: Duration,
    pub prepare: Duration,
    pub classify: Duration,
    pub admit: Duration,
    pub walk: Duration,
    pub glyphs: Duration,
    pub finish: Duration,
}
Expand description

What one SceneCompiler::compile call spent, phase by phase.

Zero across the board in a build without perf-trace — see [PhaseClock]. The phases partition the call in the order they run, so their sum is the whole compile minus call overhead. Two edges are worth naming rather than leaving to be inferred: the frame record and its depth counter are built after the admit lap, so walk spans their construction as well as the command walk itself; and the frust-perf img line a perf-trace build emits is written after the last lap, so no phase is charged the cost of reporting on one.

  1. validate — the up-front finiteness and geometry sweep over every command. A frame is refused whole or not at all, so this sweep runs before the walk records anything and is paid on every frame in the command count.
  2. prepare — resetting the per-frame scratch (strip generator, clip/group/snapshot stacks, punches) and ageing the two caches that span frames (image residency, glifo’s prep cache).
  3. classify — routing every glyph run through [crate::text::atlas_policy] before any of them is drawn.
  4. admit — closing the glyph atlas’s own frame, which is where admission packs what the routing pass asked for.
  5. walk — building the frame record the walk fills, then the command walk itself: strip generation and paint encoding, and on a text-heavy scene the bulk of the call. The part of it spent inside glyph runs is reported separately by glyphs, which is a subset of this rather than a phase of its own.
  6. finish — closing open groups, generating the hole punches, ageing the glyph atlas and taking the frame’s image plan.

Observational only: nothing downstream branches on any of it.

Fields§

§validate: Duration

The up-front finiteness and geometry sweep over every command.

§prepare: Duration

Per-frame scratch resets and the two cross-frame caches’ ageing.

§classify: Duration

Glyph-run routing, ahead of the walk.

§admit: Duration

Glyph atlas admission, closing the routing pass.

§walk: Duration

The command walk: strip generation and paint encoding.

§glyphs: Duration

The part of walk spent inside glyph runs.

A subset of walk, not a seventh phase beside it, and so deliberately excluded from Self::total: adding it would count the glyph work twice. It exists because “the walk dominates” is not on its own an actionable measurement on a text-heavy scene — whether the cost is the text or everything drawn around it is the question that decides where a lever could go.

Accumulated per Command::GlyphRun rather than per glyph: a run is the unit the cache and the atlas policy both work in, and two clock reads a glyph would cost more than the phase being measured.

§finish: Duration

Closing groups, punch generation, atlas ageing, the image plan.

Implementations§

Source§

impl CompileSpans

Source

pub fn total(&self) -> Duration

What the six phases sum to.

Saturating rather than +: a sum is only ever read by a diagnostic line, and overflowing one must not take the frame with it (E17).

Trait Implementations§

Source§

impl Clone for CompileSpans

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for CompileSpans

Source§

impl Debug for CompileSpans

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CompileSpans

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for CompileSpans

Source§

impl PartialEq for CompileSpans

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CompileSpans

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,