#[non_exhaustive]pub enum Sizing {
NotEnoughData,
Oversized {
needed: usize,
},
Fits,
TooSmall,
MuchTooSmall,
Thrashing,
}Expand description
A verdict on a cache’s capacity, from Stats::sizing.
New verdicts may be added, so a match needs a _ arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotEnoughData
Fewer than 10 * cap lookups so far: too early to judge.
Oversized
The cache never filled up. needed entries (the most it ever held) would have been
enough: a cache of that size behaves the same and uses less memory.
Fits
The cache fills up and turns over, and a bigger one would gain little: it is doing what the workload allows (with one-off scans in the traffic, that may be few hits).
TooSmall
Many hits relied on the previous generation not yet being dropped: the keys in use
somewhat outnumber cap. A larger cap, up to about twice the current one, would turn
those lucky hits into reliable ones.
MuchTooSmall
Many hits relied on the previous generation, and the hit ratio is low: the keys in use
outnumber cap several times over. A cap of a few times the current one would help a
lot; or the workload has a long tail of keys that rarely come back.
Thrashing
Fewer than one lookup in ten hits: almost nothing is used again before it is dropped. Either the cache is far too small for the keys in use, or the access pattern has little reuse to exploit.
Trait Implementations§
impl Copy for Sizing
impl Eq for Sizing
impl StructuralPartialEq for Sizing
Auto Trait Implementations§
impl Freeze for Sizing
impl RefUnwindSafe for Sizing
impl Send for Sizing
impl Sync for Sizing
impl Unpin for Sizing
impl UnsafeUnpin for Sizing
impl UnwindSafe for Sizing
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.