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]):
| call | per oid |
|---|---|
lookup | 628 ns |
lookup_batch with 1 oid | 639 ns — 1.02x worse |
lookup_batch with 100 oids | 161 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§
Trait Implementations§
Source§impl Clone for LookupPath
impl Clone for LookupPath
Source§fn clone(&self) -> LookupPath
fn clone(&self) -> LookupPath
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for LookupPath
Source§impl Debug for LookupPath
impl Debug for LookupPath
impl Eq for LookupPath
Source§impl PartialEq for LookupPath
impl PartialEq for LookupPath
impl StructuralPartialEq for LookupPath
Auto Trait Implementations§
impl Freeze for LookupPath
impl RefUnwindSafe for LookupPath
impl Send for LookupPath
impl Sync for LookupPath
impl Unpin for LookupPath
impl UnsafeUnpin for LookupPath
impl UnwindSafe for LookupPath
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§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.