Skip to content

Performance Benchmarks

All benchmarks run on Apple M-series (ARM64), single-threaded unless noted. HNSW parameters: M=16, ef_construction=200. Criterion benchmarks use release mode; recall metrics use debug mode (conservative).

DatasetMetricef_searchRecall@10Reachability
1K D=32L2501.000100%
1K D=128L2500.977100%
10K D=128L22000.966100%
1K D=32Cosine501.000100%
1K D=128Cosine500.989100%

Key observations:

  • 100% reachability across all configurations (heuristic neighbor selection, RFC-002-03)
  • Recall degrades gracefully with dimensionality, recoverable by increasing ef_search
  • Cosine and L2 show comparable recall at same parameters
ConfigurationRecall@10
1K D=32, alpha=1.0 (pure semantic)1.000
1K D=32, Range[25K,75K], alpha=1.01.000
1K D=32, alpha=0.5 (mixed)0.791

Lower recall at alpha=0.5 is expected — the composite distance prioritizes temporal proximity over semantic similarity, trading recall for temporal relevance.

AlphaAvg Temporal Distance
1.00 (pure semantic)115,400 µs
0.7585,900 µs
0.5085,900 µs
0.2544,000 µs
0.00 (pure temporal)32,100 µs

As alpha decreases, results become temporally closer to the query timestamp — validating the composite distance formula dST=αdsem+(1α)dtimed_{ST} = \alpha \cdot d_{sem} + (1-\alpha) \cdot d_{time}.

DimensionLatencyThroughput
D=324.5 ns222M pairs/sec
D=12814.7 ns68M pairs/sec
D=25633.3 ns30M pairs/sec
D=768128.7 ns7.8M pairs/sec
D=1536305.1 ns3.3M pairs/sec

10K cosine pairs at D=768: 3.39 ms (2.95M pairs/sec batch throughput)

VectorsMemoryBytes/Vector
1,0002,016 B2.016
10,0008,208 B0.821
100,00016,408 B0.164

Sub-byte per vector at scale — Roaring Bitmap compression becomes more effective with larger cardinality.

ConfigurationCompression Ratio
D=768, M=8, K=256384×
Original: 3,072 bytes/vectorPQ code: 8 bytes/vector
ScenarioResult
Stationary (200 pts, D=3)0 false positives
1 planted CP (200 pts)Detected, severity=1.000
3 planted CPs (200 pts)Precision=1.0, Recall=1.0, F1=1.0
MetricValue
Stationary FPR (500 obs)0.0000
Detection latency0 observations
ProcessHurst ExponentExpectedADF Statistic
Brownian motion (n=2000)0.542≈0.5-3.015
OU process (n=2000, θ=0.3)0.589<0.5-22.227
CrateTestsCoverage
cvx-core47Types, traits, config, errors
cvx-index81HNSW, distance, temporal, concurrent
cvx-storage71Memory, hot, warm, cold, WAL, tiered
cvx-analytics79ODE, PELT, BOCPD, calculus, ML
cvx-query118 query types
cvx-ingest20Validation pipeline
cvx-api18REST integration (all endpoints)
cvx-python22PyO3 bindings (pytest)
Total349
Terminal window
# Distance kernel benchmarks (Criterion)
cargo bench -p cvx-index --bench distance_kernels
# HNSW search benchmarks (Criterion)
cargo bench -p cvx-index --bench hnsw_search
# Analytics benchmarks (Criterion)
cargo bench -p cvx-analytics --bench analytics_bench
# Recall & metrics report
cargo test -p cvx-index --test metrics_report -- --nocapture
cargo test -p cvx-analytics --test metrics_report -- --nocapture