Expand description
ANN (Approximate Nearest Neighbour) recall and latency benchmarking.
Provides utilities for evaluating the quality and performance of ANN indices: recall@k, QPS, build time, memory usage, ground-truth generation, precision-recall tradeoff, latency percentiles, and report generation.
Structs§
- Benchmark
Report - A complete benchmark report.
- Build
Time Result - Result of a build-time measurement.
- Build
Timer - Track how long an index build takes.
- Precision
Recall Point - A data point on the precision-recall curve.
- QpsResult
- Result of a QPS measurement.
Functions§
- average_
distance_ ratio - Compute the average distance ratio: sum of approx_dist / true_dist for each query’s k-th neighbour. A perfect index has ratio = 1.0.
- brute_
force_ knn - Brute-force computation of exact k nearest neighbours for a set of queries.
- estimate_
flat_ memory - Estimate the memory footprint of a flat vector index (vectors only).
- estimate_
hnsw_ memory - Estimate memory for an HNSW-like graph index.
- estimate_
pq_ memory - Estimate memory for a product-quantised (PQ) index.
- measure_
qps - Measure queries per second for a given search function.
- per_
query_ recall - Compute recall@k for individual queries (not averaged).
- precision
- Compute precision: the fraction of returned results that are true neighbours.
- precision_
recall_ sweep - Run a sweep over a set of parameter values and collect recall/precision at each setting.
- recall_
at_ k - Compute recall@k: the fraction of true k-NN that appear in the approximate result set.
Type Aliases§
- Neighbour
- A single query result: (vector_id, distance).