Skip to main content

LookupPath

Enum LookupPath 

Source
pub enum LookupPath {
    Serial,
    Batch,
}
Expand description

Which path a lookup of n oids takes.

The number this dispatch was written for is index_layout_bench’s: on the bare Arrow arms, lookup_batch with a single element costs 818 ns against lookup’s 482 ns — 1.7x worse — because the batch path allocates a result vector, a key vector and a second pass over them to serve one oid.

RE-MEASURED against the shipping read stack, and the magnitude does not carry over. oden 2026-08-07, release, 1-min loadavg 4.94 (another tenant’s work — see LAW: never measure on a busy box, and read these as a ratio rather than as absolutes), ObjectReadStack<OneTableFourColumns> over a real repository’s 2687-object pack, 20 000 iterations ([crate::store::tests::the_batch_of_one_really_is_slower_than_the_serial_path]):

callper oid
lookup628 ns
lookup_batch with 1 oid639 ns — 1.02x worse
lookup_batch with 100 oids161 ns — 3.9x better

So: the direction holds and the dispatch is right — a batch of one is never faster — but on this stack at this size it costs 2%, not 70%. The real finding is the third row: the batch path is worth 3.9x at BATCH_SATURATES_AT, which is a much stronger reason to keep the two paths apart than the batch-of-one penalty ever was. Both numbers are stated because quoting only the 1.7x would be quoting a figure this stack does not reproduce.

The dispatch is a named function with its own guard precisely so it cannot quietly become lookup_batch for every n.

Variants§

§

Serial

One oid: ObjectIndex::lookup.

§

Batch

Two or more: ObjectIndex::lookup_batch, one pass.

Trait Implementations§

Source§

impl Clone for LookupPath

Source§

fn clone(&self) -> LookupPath

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 LookupPath

Source§

impl Debug for LookupPath

Source§

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

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

impl Eq for LookupPath

Source§

impl PartialEq for LookupPath

Source§

fn eq(&self, other: &LookupPath) -> 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 LookupPath

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = 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.