Skip to main content

Compaction

Struct Compaction 

Source
pub struct Compaction {
    pub walked: u64,
    pub moved: u64,
    pub bytes: u64,
}
Expand description

What compaction has done to a map over its life.

The write amplification of value separation, in the two parts it is actually made of. Every record the walk steps over costs a liveness probe whether it is live or not, and every live one it finds costs a copy on top of that, so a segment full of dead records and a segment full of live ones are different amounts of work for the same number of bytes. One counter cannot tell those apart, which is why there are three.

Counted here rather than in the caller because this is the only place that knows a record moved, and the numbers are wanted per store rather than per command. They never reset, including across RawMap::clear.

Fields§

§walked: u64

Records the walk has stepped over, live and dead together.

§moved: u64

The ones that were still live and had to be copied somewhere else.

§bytes: u64

What those copies came to, headers and keys included.

Trait Implementations§

Source§

impl Clone for Compaction

Source§

fn clone(&self) -> Compaction

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Compaction

Source§

impl Debug for Compaction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for Compaction

Source§

fn default() -> Compaction

Returns the “default value” for a type. Read more
Source§

impl Eq for Compaction

Source§

impl PartialEq for Compaction

Source§

fn eq(&self, other: &Compaction) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Compaction

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.