Skip to main content

BucketContainers

Struct BucketContainers 

Source
pub struct BucketContainers { /* private fields */ }
Expand description

The physical files backing the weak-super-k-mer buckets.

One container per atlas rather than one file per bucket, taking a 16,384 bucket build from 16,385 files to 129. Two things make this cheap rather than intricate. Every bucket already writes under its atlas’s mutex (SharedBucketSink::append_bucket), and a container holds exactly one atlas’s buckets, so a container is only ever written by the thread holding that lock and needs no lock of its own. And a flush no longer opens anything: BucketFile::open_existing cost an openat, seven unbuffered reads to re-read a 42-byte header, a revalidation, an lseek and a close on every 64 KiB flush, which is about eleven syscalls times the 14.4 million flushes a full-corpus build performs. A container flush is one pwrite.

The measured prize is smaller than that count suggests – partitioning’s whole system time is 436.7 s of CPU across 64 threads, so the ceiling is a couple of seconds of wall – and larger somewhere unexpected. XFS speculatively preallocates on extending writes, and with 16,385 repeatedly reopened files it held 332.7 GB for 237.8 GB of data. Writing 128 files instead returns that 94.9 GB.

Implementations§

Source§

impl BucketContainers

Source

pub fn segment_bytes(&self) -> u64

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn release_segments(&self, container: usize, segments: &[u32])

Releases a consumed bucket’s segments without disturbing its neighbours.

This is not optional, which measurement rather than reasoning settled. The per-file layout unlinked each bucket as local contraction consumed it, and containers cannot: a container is only droppable once all 128 of its buckets are done. Containers do start about 94 GB below the per-file layout, because they do not accumulate XFS speculative preallocation, and the expectation was that this covered it. It does not – the work-directory peak moves out of the end of partitioning and into local contraction, where the containers still hold everything while local-unitig buckets, labels and the edge matrix accumulate on top, and peak disk rose 24.5 GB.

Punching restores the incremental release. Segments are reserved at a 4 KiB multiple, so a punch frees whole filesystem blocks rather than leaving partial ones behind – the one thing raw extents, averaging 16.1 KiB and unaligned, could not have done. Adjacent segments are punched in one call.

Source

pub fn paths(&self) -> impl Iterator<Item = &Path>

Trait Implementations§

Source§

impl Debug for BucketContainers

Source§

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

Formats the value using the given formatter. Read more

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.