pub enum SearchStrategy {
Scalar,
SimdBruteForce,
Blas,
Accelerate,
RayonParallel,
Gpu,
IvfPq,
}Expand description
Search strategy selection based on collection size and hardware.
< 1K: Scalar (overhead of SIMD dispatch not worth it)
1K-100K: Accelerate (AMX/cblas_sgemv) > BLAS (matrixmultiply) > SIMD prenorm
1K-10K: SIMD brute force with pre-computed norms (fallback)
10K-50K: Rayon parallel SIMD (if available) OR GPU (if available)
50K-500K: GPU (if available) OR IVF-PQ
> 100K: IVF-PQ always (regardless of BLAS/GPU)Variants§
Scalar
Plain scalar search for tiny collections (< 1K).
SimdBruteForce
SIMD brute force with pre-computed norms (1K-10K).
Blas
BLAS batch matrix-vector multiply (1K-100K, requires fast-math feature).
Accelerate
Apple Accelerate / OpenBLAS cblas_sgemv (1K-100K, requires accelerate/openblas).
RayonParallel
Rayon parallel SIMD search (10K-50K, requires parallel feature).
Gpu
GPU-accelerated search (10K-500K, requires gpu feature).
IvfPq
IVF-PQ approximate search for large collections.
Trait Implementations§
Source§impl Clone for SearchStrategy
impl Clone for SearchStrategy
Source§fn clone(&self) -> SearchStrategy
fn clone(&self) -> SearchStrategy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SearchStrategy
Source§impl Debug for SearchStrategy
impl Debug for SearchStrategy
Source§impl Display for SearchStrategy
impl Display for SearchStrategy
impl Eq for SearchStrategy
Source§impl PartialEq for SearchStrategy
impl PartialEq for SearchStrategy
Source§fn eq(&self, other: &SearchStrategy) -> bool
fn eq(&self, other: &SearchStrategy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SearchStrategy
Auto Trait Implementations§
impl Freeze for SearchStrategy
impl RefUnwindSafe for SearchStrategy
impl Send for SearchStrategy
impl Sync for SearchStrategy
impl Unpin for SearchStrategy
impl UnsafeUnpin for SearchStrategy
impl UnwindSafe for SearchStrategy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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