pub enum CacheLevel {
L1,
L2,
L3,
Ram,
}Expand description
Represents a level of the memory hierarchy.
Variants§
L1
L1 data cache: typically ~32 KB, ~4 cycle latency.
L2
L2 unified cache: typically ~256 KB, ~12 cycle latency.
L3
L3 last-level cache: typically ~8 MB, ~40 cycle latency.
Ram
Main memory (RAM): 100+ cycle latency.
Implementations§
Source§impl CacheLevel
impl CacheLevel
Sourcepub fn capacity_bytes(&self) -> u64
pub fn capacity_bytes(&self) -> u64
Returns the typical capacity in bytes for this cache level.
Sourcepub fn latency_cycles(&self) -> u32
pub fn latency_cycles(&self) -> u32
Returns the typical access latency in cycles for this cache level.
Trait Implementations§
Source§impl Clone for CacheLevel
impl Clone for CacheLevel
Source§fn clone(&self) -> CacheLevel
fn clone(&self) -> CacheLevel
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 CacheLevel
impl Debug for CacheLevel
Source§impl Hash for CacheLevel
impl Hash for CacheLevel
Source§impl PartialEq for CacheLevel
impl PartialEq for CacheLevel
impl Copy for CacheLevel
impl Eq for CacheLevel
impl StructuralPartialEq for CacheLevel
Auto Trait Implementations§
impl Freeze for CacheLevel
impl RefUnwindSafe for CacheLevel
impl Send for CacheLevel
impl Sync for CacheLevel
impl Unpin for CacheLevel
impl UnsafeUnpin for CacheLevel
impl UnwindSafe for CacheLevel
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