Expand description
Batch distance computation for HNSW neighbor selection.
Instead of computing distances one-at-a-time in a loop, collects candidate vectors and computes distances in bulk. This improves cache utilization and enables SIMD-friendly memory access patterns.
Used by select_neighbors_heuristic in build.rs to accelerate
the diversity check during HNSW graph construction.
Functionsยง
- batch_
distances - Compute distances from a query vector to multiple candidate vectors.
- is_
diverse_ batched - Precompute all pairwise distances between selected neighbors and a candidate.