Skip to content

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.

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
  • 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).
IndexSettingrecall@10QPSp50 msp99 msbatch QPSbuild speak RSS MiB
FAISS IndexIVFFlatnprobe=20.99219,4600.04960.10434,1760.18973.1
FAISS IndexHNSWFlatef_search=160.96510,3670.07830.72714,0844.8573.1
hnswlib hnswef_search=160.974,3120.1891.875,6343.7973.1
SrvDB hnswef_search=160.9663,9590.2330.4454,1016.0373.1
usearch hnswef_search=160.9682,2260.3463.415,3577.5273.1
SrvDB flatn/a19980.8545.051,1960.38373.1
SrvDB sq8n/a0.9797901.212.547630.506133
FAISS IndexScalarQuantizern/a0.9757310.729.711,2900.21473.1
FAISS IndexFlatIPn/a16961.284.695,6620.086273.1
SrvDB ivfn/a14951.177.997630.97273.1
turbovec TurboQuant 2-bitn/a (target not reached)0.5591,8580.3913.595,0960.34973.1
turbovec TurboQuant 4-bitn/a (target not reached)0.8277800.7278.773,4940.66673.1
Recall@10 vs queries per second, 1 thread0.50.60.70.80.911001,00010,000100,000recall@10 (higher is better)QPS, log scale (higher is better)SrvDB flatSrvDB hnswSrvDB sq8SrvDB ivfFAISS IndexFlatIPFAISS IndexHNSWFlatFAISS IndexIVFFlatFAISS IndexScalarQuantizerhnswlib hnswusearch hnswturbovec TurboQuant 4-bitturbovec TurboQuant 2-bit
Recall@10 vs queries per second, 1 thread. synthetic-gauss(dim=384,n=5000,clusters=50,seed=42), 500 queries. Points along a line are ef_search or nprobe settings; single points are indexes without a search-time knob.
Build timeFAISS IndexFlatIP0.0862 sFAISS IndexIVFFlat0.189 sFAISS IndexScalarQuantizer0.214 sturbovec TurboQuant 2-bit0.349 sSrvDB flat0.383 sSrvDB sq80.506 sturbovec TurboQuant 4-bit0.666 sSrvDB ivf0.972 shnswlib hnsw3.79 sFAISS IndexHNSWFlat4.85 sSrvDB hnsw6.03 susearch hnsw7.52 s
Build time (1 thread, synthetic-gauss(dim=384,n=5000,clusters=50,seed=42)). Lower is better.
Peak memory (RSS)SrvDB flat73.1 MiBSrvDB hnsw73.1 MiBSrvDB ivf73.1 MiBFAISS IndexFlatIP73.1 MiBFAISS IndexHNSWFlat73.1 MiBFAISS IndexIVFFlat73.1 MiBFAISS IndexScalarQuantizer73.1 MiBhnswlib hnsw73.1 MiBusearch hnsw73.1 MiBturbovec TurboQuant 4-bit73.1 MiBturbovec TurboQuant 2-bit73.1 MiBSrvDB sq8133 MiB
Peak memory (RSS) (1 thread, synthetic-gauss(dim=384,n=5000,clusters=50,seed=42)). Lower is better.

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).
IndexSettingrecall@10QPSp50 msp99 msbatch QPSbuild speak RSS MiB
FAISS IndexIVFFlatnprobe=20.99219,0310.04910.10931,3300.49473.1
FAISS IndexHNSWFlatef_search=160.96510,0020.09650.15727,3705.0473.1
hnswlib hnswef_search=160.9698,3570.1140.18523,4751.3873.1
SrvDB hnswef_search=160.9674,3240.2250.35511,8476.5873.1
usearch hnswef_search=160.9593,0940.3010.98413,4063.9173.1
SrvDB flatn/a11,2250.7292.082,8990.20173.1
SrvDB sq8n/a0.9797540.7058.622,5690.58133
SrvDB ivfn/a16920.8337.494,3800.69173.1
FAISS IndexFlatIPn/a15201.3410.12,2930.098273.1
FAISS IndexScalarQuantizern/a0.97585.67.4458.68,2380.10973.1
turbovec TurboQuant 2-bitn/a (target not reached)0.5591,8450.4073.745,7390.30873.1
turbovec TurboQuant 4-bitn/a (target not reached)0.8277630.726.783,4300.79873.1
Recall@10 vs queries per second, 8 threads0.50.60.70.80.91101001,00010,000100,000recall@10 (higher is better)QPS, log scale (higher is better)SrvDB flatSrvDB hnswSrvDB sq8SrvDB ivfFAISS IndexFlatIPFAISS IndexHNSWFlatFAISS IndexIVFFlatFAISS IndexScalarQuantizerhnswlib hnswusearch hnswturbovec TurboQuant 4-bitturbovec TurboQuant 2-bit
Recall@10 vs queries per second, 8 threads. synthetic-gauss(dim=384,n=5000,clusters=50,seed=42), 500 queries. Points along a line are ef_search or nprobe settings; single points are indexes without a search-time knob.
Build timeFAISS IndexFlatIP0.0982 sFAISS IndexScalarQuantizer0.109 sSrvDB flat0.201 sturbovec TurboQuant 2-bit0.308 sFAISS IndexIVFFlat0.494 sSrvDB sq80.58 sSrvDB ivf0.691 sturbovec TurboQuant 4-bit0.798 shnswlib hnsw1.38 susearch hnsw3.91 sFAISS IndexHNSWFlat5.04 sSrvDB hnsw6.58 s
Build time (8 threads, synthetic-gauss(dim=384,n=5000,clusters=50,seed=42)). Lower is better.
Peak memory (RSS)SrvDB flat73.1 MiBSrvDB hnsw73.1 MiBSrvDB ivf73.1 MiBFAISS IndexFlatIP73.1 MiBFAISS IndexHNSWFlat73.1 MiBFAISS IndexIVFFlat73.1 MiBFAISS IndexScalarQuantizer73.1 MiBhnswlib hnsw73.1 MiBusearch hnsw73.1 MiBturbovec TurboQuant 4-bit73.1 MiBturbovec TurboQuant 2-bit73.1 MiBSrvDB sq8133 MiB
Peak memory (RSS) (8 threads, synthetic-gauss(dim=384,n=5000,clusters=50,seed=42)). Lower is better.

Set up a separate venv for the competitors (they are never SrvDB dependencies), build SrvDB into it, and run from a clean checkout:

Terminal window
uv venv -p 3.12 .bench-venv
uv pip install -p .bench-venv/bin/python -r benchmarks/compare/requirements.txt
VIRTUAL_ENV=$PWD/.bench-venv .bench-venv/bin/maturin develop --release
.bench-venv/bin/python benchmarks/compare/run.py --dims 384,768 --ns 5000,50000

The 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.