pub struct DistanceCost {
pub approx_s: f64,
pub exact_s: f64,
}Expand description
Per-operation cost of distance computation on the active CPU.
Approximate distances are PQ/ADC table lookups over RAM-resident codes and
are cheap; exact distances are full d-dimensional SIMD reductions over a
fetched vector. Keeping the two priced separately is what makes the
approximate-gate trade — spend cheap approximate ops to avoid expensive exact
fetches — legible in the cost model.
Costs are in seconds per operation and are expected to be obtained by offline micro-benchmarking (the SIMD bench harness) for a given dimensionality, dtype, and instruction set.
Fields§
§approx_s: f64Seconds per approximate (PQ/ADC lookup) distance.
exact_s: f64Seconds per exact (full SIMD) distance.
Implementations§
Trait Implementations§
Source§impl Clone for DistanceCost
impl Clone for DistanceCost
impl Copy for DistanceCost
Source§impl Debug for DistanceCost
impl Debug for DistanceCost
Source§impl<'de> Deserialize<'de> for DistanceCost
impl<'de> Deserialize<'de> for DistanceCost
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for DistanceCost
impl PartialEq for DistanceCost
Source§impl Serialize for DistanceCost
impl Serialize for DistanceCost
impl StructuralPartialEq for DistanceCost
Auto Trait Implementations§
impl Freeze for DistanceCost
impl RefUnwindSafe for DistanceCost
impl Send for DistanceCost
impl Sync for DistanceCost
impl Unpin for DistanceCost
impl UnsafeUnpin for DistanceCost
impl UnwindSafe for DistanceCost
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
Mutably borrows from an owned value. Read more