VelesDB Benchmark Kit

August 21, 2026 · View on GitHub

Benchmark suite comparing VelesDB against pgvector (HNSW).

Benchmark Guardrails

  • Microbench numbers are host-specific and must be reported with CPU, OS, Rust toolchain, and feature flags.
  • Internal SIMD, sparse, and VelesQL cache measurements should be run with --features internal-bench.
  • Do not claim superiority over FAISS, Qdrant, SimSIMD, or other systems unless the dataset, recall target, hardware, and methodology are matched.
  • For the latest controlled-host remediation run, see benchmarks/results/2026-03-10-perf-remediation-report.md.

Benchmark Modes

1. Docker vs Docker (Fair comparison)

docker-compose up -d --build  # Start both servers
python benchmark_docker.py --vectors 5000 --clusters 25
DatabaseModeWhat it measures
VelesDBREST API (Docker)Client-server via HTTP
pgvectorDocker + PostgreSQLClient-server via SQL

2. Native vs Docker (Embedded advantage)

python benchmark_recall.py --vectors 10000
DatabaseModeWhat it measures
VelesDBNative Python (PyO3)Best-case embedded performance
pgvectorDocker + PostgreSQLClient-server with SQL overhead

Quick Start

# 1. Start both servers (Docker required)
docker-compose up -d --build

# 2. Install dependencies
pip install -r requirements.txt

# 3. Run fair Docker benchmark
python benchmark_docker.py --vectors 5000 --clusters 25

Options

# Both scripts support:
--vectors 5000     # Dataset size
--dim 768          # Vector dimension  
--queries 100      # Number of queries
--clusters 25      # Data clusters (realistic)

# Docker benchmark only:
--velesdb-url http://localhost:8080

Methodology

Fair Comparison

Both databases are measured with total time including index construction:

  • VelesDB: Insert + inline HNSW indexing
  • pgvector: Raw INSERT + separate CREATE INDEX time

This ensures an apples-to-apples comparison of the complete ingestion pipeline.

Controlled-host microbenchmarks

Use these commands for host-local remediation runs:

cargo bench -p velesdb-core --features internal-bench --bench simd_benchmark -- 768 --noplot
cargo bench -p velesdb-core --features internal-bench --bench sparse_benchmark -- sparse_insert --noplot
cargo bench -p velesdb-core --features internal-bench --bench velesql_benchmark -- velesql_cache --noplot

Report the exact host and toolchain alongside the measured values.

HNSW Parameters (Adaptive)

VelesDB uses adaptive parameters based on dataset size:

Dataset SizeMef_constructionTarget Recall
≤10K32400≥98%
≤100K64800≥95%
≤500K961200≥95%
≤1M1281600≥95%
// Automatic parameter selection
let params = HnswParams::for_dataset_size(768, 100_000);
// Or for 1M scale
let params = HnswParams::million_scale(768);

When to Choose Each

Use CaseRecommendation
Bulk import speedVelesDB ✅ (3.2x faster)
Embedded/Desktop appsVelesDB
Real-time (<10ms)VelesDB
Edge/IoT/WASMVelesDB
Existing PostgreSQLpgvector
SQL ecosystempgvector

License

This benchmark suite is part of the VelesDB repository and is covered by the VelesDB Core License 1.0, like the rest of the tree.