Benchmarks
Performance benchmarks and methodology for v1.0.0
CortexaDB delivers fast, local vector search optimized for AI agent memory workloads. Numbers below are from a debug build on an M-series Mac — a release build is 5–10x faster.
Performance Overview
Key metrics measured with 10,000 embeddings (384 dimensions) on an M-series Mac, v1.0.0 debug build.
1.03ms p50 Search
HNSW search on 10,000 vectors. Release build achieves ~0.3ms p50.
952+ QPS
HNSW throughput (debug build). Release build exceeds 3,000 QPS.
95% Recall
Approximate search maintains high accuracy relative to brute-force.
Retrieval Benchmarks
Measured: 10,000 embeddings × 384 dimensions, 1,000 queries, 100 warmup, top-10.
| Mode | p50 | p95 | p99 | Throughput | Recall | Disk |
|---|---|---|---|---|---|---|
| HNSW | 1.03ms | 1.18ms | 1.29ms | 952 QPS | 95% | 47 MB |
| Exact | 16.38ms | 22.69ms | 35.77ms | 56 QPS | 100% | 31 MB |
[!NOTE] These numbers are from a debug build (
maturin develop). With a release build (maturin develop --release), HNSW achieves ~0.3ms p50 and 3,000+ QPS — consistent with the ingestion benchmarks below.
Ingestion
| Operation | Time |
|---|---|
| Bulk Ingest (1,000 chunks) | 0.12s |
| Single Memory Add | 1ms |
| HNSW Index Build (10,000 vectors) | ~286s (debug) / ~140s (release) |
Methodology
- Dataset: 10,000 random embeddings × 384 dimensions.
- Environment: M-series Mac. Debug build via
maturin develop. - Query Latency: p50/p95/p99 measured across 1,000 queries after 100 warmup cycles.
- Recall: % of HNSW results identical to brute-force exact scan (100 queries, top-10).
Reproducing Results
Build the release extension for best performance:
cd crates/cortexadb-py
maturin develop --release
cd ../..
pip install numpy psutilRun the automated benchmark suite:
# Generate 10k test vectors
python3 benchmark/generate_embeddings.py --count 10000 --dimensions 384
# Benchmark HNSW performance
python3 benchmark/run_benchmark.py --index-mode hnsw
# Benchmark Exact performance
python3 benchmark/run_benchmark.py --index-mode exactDecision Guide
| Metric | Use Exact | Use HNSW |
|---|---|---|
| Dataset Size | < 10,000 entries | > 10,000 entries |
| Recall Needed | 100% (Strict) | 95-99% (Semantic) |
| Latency Target | < 20ms (debug) / < 2ms (release) | < 5ms (debug) / < 1ms (release) |
| Resource Profile | Minimum Memory | High Performance |
[!TIP] For datasets between 1k and 10k, Exact mode is often a good choice due to zero index-building overhead and 100% recall. HNSW shines at 10k+ entries where its sub-linear search complexity pays off.
Next Steps
- Indexing - HNSW configuration and tuning
- Configuration - All database options
