mlsanityData to 14 Oct 2026

KNN Implementation Details Can Dramatically Change Performance: An Example from Cover Trees

arXiv 2610.16940 ↗First posted 12 Oct 2026cs.LG cs.AI cs.IRcited by 0

Not on the map. Why?

Abstract (arXiv)

Nearest neighbor search algorithms are widely used and have a long history, but we find that key implementation details are seldom reviewed in articles about them. These details can materially impact performance, and thus change the conclusions one makes about a given algorithm's superiority. In this article, we highlight these impacts by reviewing the Cover Tree as an example, producing RustKNN, a unified Rust implementation of three construction variants of the Cover Tree with three query modes. Our analysis reveals: (1) the optimal query strategy depends on k and on the dataset (single-tree search is fastest at k=1 on three of our four largest datasets, while dual-tree search is fastest at k≥5 on the three largest), and choosing the wrong query mode can cost up to a 7.5× factor in runtime; (2) the cover tree base parameter, set to 2 in theory and 1.3 in practice, is not a safe default for dual-tree search: 1.3 is optimal on only one of seven datasets, and on covtype it is 1.6× slower than the optimum; (3) among five micro-optimizations, only early-exit distance computation has a consistent effect, and that effect grows with dimension (none at d=32, 1.31× at d=54, and 1.49× at d=784); and (4) all-nearest-neighbor and held-out benchmarks yield different implementation rankings. All main timing tables report medians over 20 independent allocations with bootstrap 95% confidence intervals. RustKNN is open source at https://github.com/CrowdStrike/RustKNN.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 10 of its 88 references that are in the map. First posted on arXiv 12 Oct 2026.

Builds on

10 of 88 references.

References · 10

  1. 2017Billion-scale similarity search with GPUscited by 2,497
  2. 2016Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphscited by 861
  3. 2020Research Reproducibility as a Survival Analysiscited by 16
  4. 2024What Do Machine Learning Researchers Mean by "Reproducible"?cited by 9
  5. 2021A new near-linear time algorithm for k-nearest neighbor search using a compressed cover treecited by 8
  6. 2022A Siren Song of Open Source Reproducibilitycited by 8
  7. 2013Tree-Independent Dual-Tree Algorithmscited by 5
  8. 2018Testing Scientific Software: A Systematic Literature Reviewcited by 4
  9. 2022Counterexamples expose gaps in the proof of time complexity for cover trees introduced in 2006cited by 3
  10. 2018Toward Metric Indexes for Incremental Insertion and Queryingcited by 2

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2024Revisiting the Index Construction of Proximity Graph-Based Approximate Nearest Neighbor Search
  2. 2025Graph-based Nearest Neighbors with Dynamic Updates via Random Walks
  3. 2025ETS: Efficient Tree Search for Inference-Time Scaling
  4. 2023The Effect of Points Dispersion on the k-nn Search in Random Projection Forests
  5. 2026ANN Search: Recall What Matters
  6. 2025Approximate Diverse k-nearest Neighbor Search in Vector Database
  7. 2026Unified Dominance Graph for Interval-Predicate Approximate Nearest Neighbor Search ↗
  8. 2026Filtered Approximate Nearest Neighbor Search in Vector Databases: System Design and Performance Analysis