pub struct ImpactEstimate {
pub savings_per_instance: usize,
pub cache_line_size: usize,
pub current_cache_lines: usize,
pub optimal_cache_lines: usize,
pub extra_bytes_1k: usize,
pub extra_bytes_1m: usize,
pub extra_cache_lines_1k: usize,
pub extra_cache_lines_1m: usize,
}Expand description
Estimated impact of a struct layout inefficiency at various scales.
Built from estimate_impact. All “extra” figures are relative to the
layout produced by reorder::reorder_savings (the optimal field order).
Fields§
§savings_per_instance: usizeBytes saved per instance by applying the optimal field ordering.
cache_line_size: usizeCache-line size used for this estimate (bytes).
current_cache_lines: usizeCache lines occupied by the current layout per instance.
optimal_cache_lines: usizeCache lines that would be occupied by the optimal layout per instance.
extra_bytes_1k: usizeExtra bytes across 1 000 instances (savings × 1 000).
extra_bytes_1m: usizeExtra bytes across 1 000 000 instances (savings × 1 000 000).
extra_cache_lines_1k: usizeApproximate extra cache lines loaded for a sequential scan of 1 000 instances.
extra_cache_lines_1m: usizeApproximate extra cache lines loaded for a sequential scan of 1 000 000 instances.
Implementations§
Source§impl ImpactEstimate
impl ImpactEstimate
Sourcepub fn reduces_cache_line_crossings(&self) -> bool
pub fn reduces_cache_line_crossings(&self) -> bool
Returns true when the current layout occupies more cache lines per
instance than the optimal layout, meaning a reorder would reduce
cache-line crossings on random access.
Trait Implementations§
Source§impl Clone for ImpactEstimate
impl Clone for ImpactEstimate
Source§fn clone(&self) -> ImpactEstimate
fn clone(&self) -> ImpactEstimate
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ImpactEstimate
impl Debug for ImpactEstimate
Source§impl PartialEq for ImpactEstimate
impl PartialEq for ImpactEstimate
impl StructuralPartialEq for ImpactEstimate
Auto Trait Implementations§
impl Freeze for ImpactEstimate
impl RefUnwindSafe for ImpactEstimate
impl Send for ImpactEstimate
impl Sync for ImpactEstimate
impl Unpin for ImpactEstimate
impl UnsafeUnpin for ImpactEstimate
impl UnwindSafe for ImpactEstimate
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more