pub struct PresentStats {
pub bytes_emitted: u64,
pub cells_changed: usize,
pub run_count: usize,
pub duration: Duration,
}Expand description
Statistics from a present() operation.
Captures metrics for verifying O(changes) output size and detecting performance regressions.
Fields§
§bytes_emitted: u64Bytes emitted for this frame.
cells_changed: usizeNumber of cells changed.
run_count: usizeNumber of runs (groups of consecutive changes).
duration: DurationTime spent in present().
Implementations§
Source§impl PresentStats
impl PresentStats
Sourcepub fn new(
bytes_emitted: u64,
cells_changed: usize,
run_count: usize,
duration: Duration,
) -> Self
pub fn new( bytes_emitted: u64, cells_changed: usize, run_count: usize, duration: Duration, ) -> Self
Create new stats with the given values.
Sourcepub fn bytes_per_cell(&self) -> f64
pub fn bytes_per_cell(&self) -> f64
Calculate bytes per cell changed.
Returns 0.0 if no cells were changed.
Sourcepub fn bytes_per_run(&self) -> f64
pub fn bytes_per_run(&self) -> f64
Calculate bytes per run.
Returns 0.0 if no runs.
Sourcepub fn within_budget(&self) -> bool
pub fn within_budget(&self) -> bool
Check if output is within the expected budget.
Uses conservative estimates for worst-case bytes per cell.
Trait Implementations§
Source§impl Clone for PresentStats
impl Clone for PresentStats
Source§fn clone(&self) -> PresentStats
fn clone(&self) -> PresentStats
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PresentStats
impl Debug for PresentStats
Source§impl Default for PresentStats
impl Default for PresentStats
Source§impl PartialEq for PresentStats
impl PartialEq for PresentStats
impl Eq for PresentStats
impl StructuralPartialEq for PresentStats
Auto Trait Implementations§
impl Freeze for PresentStats
impl RefUnwindSafe for PresentStats
impl Send for PresentStats
impl Sync for PresentStats
impl Unpin for PresentStats
impl UnsafeUnpin for PresentStats
impl UnwindSafe for PresentStats
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more