Project
Benchmarks
SrvDB measured against FAISS, hnswlib, usearch and turbovec on the same data, with the environment and the command to reproduce every number.
Every number and chart on this page is generated at build time from
website/src/data/benchmarks/comparison.json,
written by the comparison runner in benchmarks/compare/. Nothing is typed
by hand. The numbers describe one laptop and one synthetic dataset; measure
on your own hardware before you rely on them.
Environment
Section titled “Environment”- CPU
- AMD Ryzen 5 3550H with Radeon Vega Mobile Gfx (4 cores, 8 threads)
- RAM
- 16.9 GiB
- OS
- Ubuntu 26.04.1 LTS (kernel 7.0.0-43-generic), Python 3.12.13
- SrvDB commit
e5bf55644b7f- Versions
- srvdb 0.3.0, faiss-cpu 1.16.0, hnswlib 0.8.0, usearch 2.26.6, turbovec 1.1.2, numpy 2.5.5
- Parameters
- k=10, HNSW M=16, ef_construction=200, ef_search sweep 10, 16, 32, 64, 128, 256, IVF nlist sqrt(n), nprobe sweep 1, 2, 4, 8, 16, 32 (SrvDB IVF nprobe 8), threads 1 and 8
- Command
python benchmarks/compare/run.py --dims 384,768 --ns 5000,50000
How to read this
Section titled “How to read this”- recall@10 is the share of the exact top 10 (brute-force cosine search) that an index returns. 1.0 is perfect.
- QPS is one query per call from one caller thread, through each library’s Python API. batch QPS sends all queries in one call.
- Build for SrvDB includes writing to disk and
persist()(the data survives a crash). The other libraries build in memory only and save nothing. This is part of what SrvDB is for, and it costs time. - Peak RSS is the whole process, including the dataset copy the runner holds, which is the same for every index.
- 1 thread limits every library (and SrvDB’s internal pool) to one thread. All threads lets each use every core.
SrvDB rows and lines are highlighted. The summary lists each index’s fastest setting that reaches recall@10 of at least 0.95, and says in plain words where SrvDB is slower as well as where it is faster.
dim 384, 5,000 vectors, 1 thread
- At recall@10 of at least 95%, SrvDB loses on query speed: FAISS IndexIVFFlat answers 4.9x more queries per second than SrvDB's fastest index (hnsw).
- SrvDB hnsw is faster than: usearch hnsw, FAISS IndexScalarQuantizer, FAISS IndexFlatIP.
- Build time for SrvDB hnsw ranks 11 of 12 (it includes a durable persist() to disk; the others build in memory only).
| Index | Setting | recall@10 | QPS | p50 ms | p99 ms | batch QPS | build s | peak RSS MiB |
|---|---|---|---|---|---|---|---|---|
| FAISS IndexIVFFlat | nprobe=2 | 0.992 | 19,460 | 0.0496 | 0.104 | 34,176 | 0.189 | 73.1 |
| FAISS IndexHNSWFlat | ef_search=16 | 0.965 | 10,367 | 0.0783 | 0.727 | 14,084 | 4.85 | 73.1 |
| hnswlib hnsw | ef_search=16 | 0.97 | 4,312 | 0.189 | 1.87 | 5,634 | 3.79 | 73.1 |
| SrvDB hnsw | ef_search=16 | 0.966 | 3,959 | 0.233 | 0.445 | 4,101 | 6.03 | 73.1 |
| usearch hnsw | ef_search=16 | 0.968 | 2,226 | 0.346 | 3.41 | 5,357 | 7.52 | 73.1 |
| SrvDB flat | n/a | 1 | 998 | 0.854 | 5.05 | 1,196 | 0.383 | 73.1 |
| SrvDB sq8 | n/a | 0.979 | 790 | 1.21 | 2.54 | 763 | 0.506 | 133 |
| FAISS IndexScalarQuantizer | n/a | 0.975 | 731 | 0.72 | 9.71 | 1,290 | 0.214 | 73.1 |
| FAISS IndexFlatIP | n/a | 1 | 696 | 1.28 | 4.69 | 5,662 | 0.0862 | 73.1 |
| SrvDB ivf | n/a | 1 | 495 | 1.17 | 7.99 | 763 | 0.972 | 73.1 |
| turbovec TurboQuant 2-bit | n/a (target not reached) | 0.559 | 1,858 | 0.391 | 3.59 | 5,096 | 0.349 | 73.1 |
| turbovec TurboQuant 4-bit | n/a (target not reached) | 0.827 | 780 | 0.727 | 8.77 | 3,494 | 0.666 | 73.1 |
dim 384, 5,000 vectors, 8 threads
- At recall@10 of at least 95%, SrvDB loses on query speed: FAISS IndexIVFFlat answers 4.4x more queries per second than SrvDB's fastest index (hnsw).
- SrvDB hnsw is faster than: usearch hnsw, FAISS IndexFlatIP, FAISS IndexScalarQuantizer.
- Build time for SrvDB hnsw ranks 12 of 12 (it includes a durable persist() to disk; the others build in memory only).
| Index | Setting | recall@10 | QPS | p50 ms | p99 ms | batch QPS | build s | peak RSS MiB |
|---|---|---|---|---|---|---|---|---|
| FAISS IndexIVFFlat | nprobe=2 | 0.992 | 19,031 | 0.0491 | 0.109 | 31,330 | 0.494 | 73.1 |
| FAISS IndexHNSWFlat | ef_search=16 | 0.965 | 10,002 | 0.0965 | 0.157 | 27,370 | 5.04 | 73.1 |
| hnswlib hnsw | ef_search=16 | 0.969 | 8,357 | 0.114 | 0.185 | 23,475 | 1.38 | 73.1 |
| SrvDB hnsw | ef_search=16 | 0.967 | 4,324 | 0.225 | 0.355 | 11,847 | 6.58 | 73.1 |
| usearch hnsw | ef_search=16 | 0.959 | 3,094 | 0.301 | 0.984 | 13,406 | 3.91 | 73.1 |
| SrvDB flat | n/a | 1 | 1,225 | 0.729 | 2.08 | 2,899 | 0.201 | 73.1 |
| SrvDB sq8 | n/a | 0.979 | 754 | 0.705 | 8.62 | 2,569 | 0.58 | 133 |
| SrvDB ivf | n/a | 1 | 692 | 0.833 | 7.49 | 4,380 | 0.691 | 73.1 |
| FAISS IndexFlatIP | n/a | 1 | 520 | 1.34 | 10.1 | 2,293 | 0.0982 | 73.1 |
| FAISS IndexScalarQuantizer | n/a | 0.975 | 85.6 | 7.44 | 58.6 | 8,238 | 0.109 | 73.1 |
| turbovec TurboQuant 2-bit | n/a (target not reached) | 0.559 | 1,845 | 0.407 | 3.74 | 5,739 | 0.308 | 73.1 |
| turbovec TurboQuant 4-bit | n/a (target not reached) | 0.827 | 763 | 0.72 | 6.78 | 3,430 | 0.798 | 73.1 |
Reproduce
Section titled “Reproduce”Set up a separate venv for the competitors (they are never SrvDB dependencies), build SrvDB into it, and run from a clean checkout:
uv venv -p 3.12 .bench-venvuv pip install -p .bench-venv/bin/python -r benchmarks/compare/requirements.txtVIRTUAL_ENV=$PWD/.bench-venv .bench-venv/bin/maturin develop --release.bench-venv/bin/python benchmarks/compare/run.py --dims 384,768 --ns 5000,50000The run rewrites website/src/data/benchmarks/comparison.json; rebuild the
site to update this page. Method details and licences of the compared
libraries are in benchmarks/compare/README.md; SrvDB’s own per-mode
harness is described in docs/benchmarks.md.
Was this page helpful? Tell us in Discussions.