Project
Memory and recall
Bytes per vector and recall@10 for every SrvDB mode on DBpedia OpenAI embeddings, NYTimes and GloVe, with the environment and command to reproduce them.
How much memory does each SrvDB mode need per vector, and what recall
does it keep? Every number on this page is read at build time from
website/src/data/benchmarks/memory-recall.json,
a copy of benchmarks/social/results.json. Nothing is typed by hand.
Speed is not measured here; it waits for an idle-machine run.
What the columns mean
Section titled “What the columns mean”- Search bytes/vector: what a search scans per vector,
db.memory_report()["vector_bytes"] / n. float32 for flat, codes otherwise. - Disk total/vector: every file in the database directory divided by n. Files are preallocated beyond n, and RaBitQ keeps the float32 vectors on disk for exact rerank, so this is larger than the search bytes.
- Recall@10: against the dataset’s ground truth (ann-benchmarks
neighbours, or exact numpy search), default settings. “No rerank” is
RaBitQ with
set_rabitq_rerank(0). - Peak RSS: of the measuring process, including the benchmark’s own copy of the vectors.
How to read the tables: bold recall is the highest recall on that dataset. The row marked ★ best trade-off is the smallest mode whose recall is within 0.005 of exact float32 search. That’s the mode to pick when you want exact-search quality at the lowest memory. PQ is never marked, even though it is small, because its recall is far below exact search.
NYTimes (256-d, ann-benchmarks)
Source: http://ann-benchmarks.com/nytimes-256-angular.hdf5. Licence: derived from UCI Bag of Words (NYTimes), CC BY 4.0. Ground truth: ann-benchmarks neighbors (first queries).
| Mode | Search bytes/vector | Smaller than float32 | Disk total/vector | Recall@10 | No rerank | Peak RSS (MiB) |
|---|---|---|---|---|---|---|
| float32 (flat) | 1,024 | 1.0× | 1,238 | 0.9846 | – | 839 |
| SQ8 | 256 | 4.0× | 333 | 0.9768 | – | 633 |
| PQ | 32 | 32.0× | 70 | 0.5881 | – | 522 |
| RaBitQ 4-bit | 136 | 7.5× | 1,381 | 0.9848 | 0.9133 | 769 |
| RaBitQ 2-bit ★ best trade-off | 72 | 14.2× | 1,312 | 0.9827 | 0.7652 | 754 |
| RaBitQ 1-bit | 40 | 25.6× | 1,277 | 0.9469 | 0.5859 | 783 |
GloVe-100 (100-d, ann-benchmarks)
Source: http://ann-benchmarks.com/glove-100-angular.hdf5. Licence: GloVe vectors, PDDL 1.0. Ground truth: ann-benchmarks neighbors (first queries).
| Mode | Search bytes/vector | Smaller than float32 | Disk total/vector | Recall@10 | No rerank | Peak RSS (MiB) |
|---|---|---|---|---|---|---|
| float32 (flat) | 400 | 1.0× | 616 | 0.9999 | – | 1,620 |
| SQ8 | 100 | 4.0× | 178 | 0.9765 | – | 1,332 |
| PQ | 25 | 16.0× | 68 | 0.3927 | – | 1,221 |
| RaBitQ 4-bit ★ best trade-off | 58 | 6.9× | 689 | 0.9999 | 0.8439 | 1,378 |
| RaBitQ 2-bit | 33 | 12.1× | 655 | 0.9758 | 0.5294 | 1,414 |
| RaBitQ 1-bit | 21 | 19.0× | 639 | 0.7685 | 0.2385 | 1,510 |
DBpedia, OpenAI ada-002 (1536-d, 100k)
Source: https://huggingface.co/datasets/KShivendu/dbpedia-entities-openai-1M. Licence: MIT (Hugging Face dataset card). Ground truth: numpy exact cosine brute force.
| Mode | Search bytes/vector | Smaller than float32 | Disk total/vector | Recall@10 | No rerank | Peak RSS (MiB) |
|---|---|---|---|---|---|---|
| float32 (flat) | 6,144 | 1.0× | 6,252 | 1.0000 | – | 1,397 |
| SQ8 | 1,536 | 4.0× | 1,587 | 0.9963 | – | 977 |
| PQ | 192 | 32.0× | 242 | 0.7882 | – | 835 |
| RaBitQ 4-bit | 776 | 7.9× | 7,333 | 1.0000 | 0.9443 | 1,451 |
| RaBitQ 2-bit | 392 | 15.7× | 6,795 | 1.0000 | 0.8354 | 1,415 |
| RaBitQ 1-bit ★ best trade-off | 200 | 30.7× | 6,526 | 0.9999 | 0.7035 | 1,400 |
Synthetic clustered (768-d, seed 42)
Source: seeded clustered Gaussian (numpy, seed 42), offline. Licence: generated. Ground truth: numpy exact cosine brute force.
| Mode | Search bytes/vector | Smaller than float32 | Disk total/vector | Recall@10 | No rerank | Peak RSS (MiB) |
|---|---|---|---|---|---|---|
| float32 (flat) | 3,072 | 1.0× | 4,179 | 1.0000 | – | 452 |
| SQ8 | 768 | 4.0× | 1,069 | 0.9637 | – | 323 |
| PQ | 96 | 32.0× | 178 | 0.1235 | – | 285 |
| RaBitQ 4-bit ★ best trade-off | 392 | 7.8× | 4,662 | 1.0000 | 0.7301 | 467 |
| RaBitQ 2-bit | 200 | 15.4× | 4,423 | 0.9900 | 0.3626 | 450 |
| RaBitQ 1-bit | 104 | 29.5× | 4,303 | 0.9934 | 0.1677 | 452 |
Known weak spot: PQ
Section titled “Known weak spot: PQ”PQ recall is low on every dataset here (see the tables). This is tracked in issue #95; use RaBitQ for compressed search until it is fixed.
Environment
Section titled “Environment”- CPU: AMD Ryzen 5 3550H with Radeon Vega Mobile Gfx (8 logical CPUs), 16.9 GiB RAM
- OS: Linux 7.0.0-43-generic, Python 3.12.13
- SrvDB 0.4.0, commit
6a3635f - Command:
python benchmarks/social/run.py --crash
Reproduce
Section titled “Reproduce”uv venv -p 3.12 .bench-venvuv pip install -p .bench-venv/bin/python numpy matplotlib h5py pyarrow maturinVIRTUAL_ENV=$PWD/.bench-venv .bench-venv/bin/maturin develop --release.bench-venv/bin/python benchmarks/social/run.pyDatasets are downloaded by the benchmark script (never by SrvDB) into a
gitignored cache and verified by size and SHA256. See
benchmarks/social/README.md
and the full report.
Was this page helpful? Tell us in Discussions.