Welcome to the Vex documentation! This directory contains detailed guides for building, testing, and optimizing the Vex vector database.
- PERFORMANCE.md - Comprehensive guide to SIMD optimizations, benchmarking, and performance analysis
- Performance benchmark results
- How to run performance tests
- Detailed analysis of speedups
- Memory efficiency analysis
- BUILD.md - Instructions for compiling SIMD assembly from C code
- Setting up the build environment
- Using Docker with goat
- Generating assembly code
- Troubleshooting build issues
# Quick dot product benchmark
cd internal/vector
go test -bench=BenchmarkDotProductComparison -benchtime=3s -benchmem
# HNSW index benchmarks
cd benchmarks/storage
go test -bench=BenchmarkIndexSearch_Comparison_128D_10K -benchtime=2s# First, build the Docker image if not already built
docker build -f Dockerfile.goat -t goat-builder:latest .
# Using Docker (recommended)
docker run -it --rm -v ~/wp/vex:/app -w /app/internal/vector/asm goat-builder:latest bash
goat ../c/dot_avx256_amd64.c -O3 -mavx2 -mfmaVex includes SIMD assembly for dot products on supported AMD64 CPUs. Runtime speedup depends on CPU features, vector dimension, and thermal/frequency state, so measure on the target machine before publishing performance numbers:
go test -run='^$' -bench=BenchmarkDotProductComparison -benchmem ./internal/vector
go test -tags=noasm -run='^$' -bench=BenchmarkDotProduct -benchmem ./internal/vectorvex/
├── docs/ # Documentation (you are here)
│ ├── README.md # This file
│ ├── PERFORMANCE.md # Performance guide
│ └── BUILD.md # Build instructions
├── internal/
│ ├── vector/ # Vector operations
│ │ ├── c/ # C source for SIMD
│ │ ├── asm/ # Generated assembly
│ │ └── *.go # Go implementation
│ └── storage/ # Storage layer
│ ├── index_hnsw.go # HNSW index
│ └── index_bruteforce.go
├── benchmarks/ # Performance benchmarks
│ └── storage/
└── cmd/ # Command-line tools
When contributing performance improvements:
- Modify C code in
internal/vector/c/ - Regenerate assembly using goat (see BUILD.md)
- Run tests:
go test ./... - Run benchmarks: Document performance changes
- Update docs: If changing APIs or performance characteristics
Vex is licensed under Apache License 2.0.
This project includes SIMD optimization code derived from Weaviate (BSD-3-Clause), which is fully compatible with Apache 2.0.
📄 License Documentation:
- LICENSES.md - Complete license information
- THIRD_PARTY_LICENSES.md - Third-party license texts
- NOTICE - Attribution notices
- Weaviate Vector Database - Reference implementation for SIMD optimizations
- Intel Intrinsics Guide - SIMD instruction reference
- Go Assembly Documentation - Go assembly language reference
- Main README:
../README.md- Project overview and getting started - API Documentation: Generate with
godoc -http=:6060
If you encounter issues:
- Check the troubleshooting sections in BUILD.md and PERFORMANCE.md
- Verify your environment matches the prerequisites
- Run tests with
-vflag for detailed output - Check CPU features:
grep avx2 /proc/cpuinfo
Apache License 2.0 - See LICENSE file in the project root