This document explains how to measure Vectro's performance and what conditions affect the numbers you'll see.
When used: If Mojo binary is not available or built
Throughput: ~60–80K vec/s for INT8 at d=768 (depends on backend availability)
Factors affecting throughput:
squish_quantRust extension availability → ~3-4x speedup if installed- NumPy BLAS configuration (OpenBLAS vs MKL → 2-3x difference)
- Batch size (larger batches → 10% faster, due to reduced Python overhead)
- Vector dimensionality (lower dims → higher throughput due to better cache locality)
Measured (March 2026, codespace CPU, NumPy-only):
d=768: 62K vec/s (batch=10000)
d=384: 69K vec/s (batch=10000)
d=128: 77K vec/s (batch=10000)
When used: After running pixi run build-mojo
Throughput: 5M+ vec/s for INT8 at d=768 (Apple M-series / modern x86)
Conditions for these numbers:
- M-series Mac (Apple Silicon) or modern NVIDIA GPU
- Compiled Mojo binary with SIMD vectorization
- Batch size >= 1000 (smaller batches have dispatch overhead)
Always available, no dependencies beyond numpy + pip:
python benchmarks/benchmark_python_fallback.py --output results/fallback_benchmark.jsonOutputs JSON with:
- INT8 throughput at dimensions [128, 384, 768, 1536]
- Quality metrics (cosine similarity, compression ratio)
- Multiple batch sizes
On a system with Mojo installed:
# Build the binary (one-time)
pixi run build-mojo
# Run benchmarks
pixi run benchmark
# Output format: Vec/s, cosine_sim, and compression_ratio for INT8/NF4/BinaryThis runs: ./vectro_quantizer benchmark 10000 768
| Mode | d=768 | Condition |
|---|---|---|
| NumPy (no squish) | 60-80K | Pure Python + NumPy BLAS |
| NumPy (+ squish) | 200-300K | With Rust INT8 fallback |
| Mojo SIMD | 5M+ | Apple Silicon or x86 SIMD |
| Mojo + GPU | 50M+ | NVIDIA A100 / Apple GPU |
- Exact numbers will vary by ±20% due to system load, Python GIL contention, etc.
- Small batches (size=100) are slower due to dispatch overhead — use batch >= 1000 for fair comparison
- Relative comparison: Mojo should be 50-100x faster than NumPy on your hardware
- Quality metrics: cosine_sim >= 0.9999 for INT8, >= 0.98 for NF4
- Reproducibility: Run the same benchmark twice; results should match within ~5%
If you publish results, include:
-
Configuration:
Vectro version(e.g., v3.4.0)Python version(e.g., 3.11.9)NumPy version(e.g., 1.24.3)squish_quantpresence (yes/no)Mojo version(if using binary)
-
Hardware:
- CPU model (e.g., Apple M3 Pro)
- RAM
- NUMA configuration (if relevant)
-
Methodology:
- Vector data source (random, real embeddings, etc.)
- Dimensions tested
- Batch sizes used
- Warm-up iterations
- Number of trial runs
-
Results:
- Raw JSON from benchmark script
- Summary table
- Comparison to Faiss/ONNX/etc. if available
- NumPy throughput claims in README (200K–1.04M vec/s): These were measured with squish_quant. Without it, expect 60–80K vec/s.
- Mojo binary builds require Mojo >= 0.25.7 on Apple Silicon (Linux/x86 support in-progress).
- GPU benchmarks require MAX Engine SDK to enable GPU path. Falls back to CPU SIMD if unavailable.
- Batch size very important: OPT-in batches of 10000 for repeatability; don't compare batch=100 to batch=10000.
To compare against Faiss on standard ANN benchmarks:
- Install faiss:
pip install faiss-cpu(or faiss-gpu) - Download SIFT1M or Glove-100 benchmark dataset
- Run PQ compression at the same compression ratio on both libraries
- Compare recall@10, throughput, and memory footprint
Vectro's HNSW index should yield recall@10 >= 0.97 on 1M vectors with INT8 storage.