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 more