pub struct ConstPropStats {
pub arithmetic_folds: u64,
pub comparison_folds: u64,
pub boolean_folds: u64,
pub nodes_before: u64,
pub nodes_after: u64,
pub passes: u32,
}Expand description
Statistics collected during a constant propagation run.
Fields§
§arithmetic_folds: u64Number of arithmetic binary folding operations
(e.g. Add(1,2) → 3, Mul(2,3) → 6).
comparison_folds: u64Number of comparison folding operations
(e.g. Lt(1,2) → True, Eq(3,3) → True).
boolean_folds: u64Number of boolean/unary constant folding operations
(e.g. Not(True) → False, Abs(-3) → 3).
nodes_before: u64Total expression nodes counted before the first pass.
nodes_after: u64Total expression nodes counted after the last pass.
passes: u32Number of passes executed.
Implementations§
Source§impl ConstPropStats
impl ConstPropStats
Sourcepub fn total_folds(&self) -> u64
pub fn total_folds(&self) -> u64
Total folds across all categories.
Sourcepub fn reduction_pct(&self) -> f64
pub fn reduction_pct(&self) -> f64
Fraction of nodes removed: (before − after) / before.
Returns 0.0 when nodes_before == 0.
Trait Implementations§
Source§impl Clone for ConstPropStats
impl Clone for ConstPropStats
Source§fn clone(&self) -> ConstPropStats
fn clone(&self) -> ConstPropStats
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 ConstPropStats
impl Debug for ConstPropStats
Source§impl Default for ConstPropStats
impl Default for ConstPropStats
Source§fn default() -> ConstPropStats
fn default() -> ConstPropStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ConstPropStats
impl RefUnwindSafe for ConstPropStats
impl Send for ConstPropStats
impl Sync for ConstPropStats
impl Unpin for ConstPropStats
impl UnsafeUnpin for ConstPropStats
impl UnwindSafe for ConstPropStats
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