This project provides a benchmarking suite to compare TurboVec (a quantized vector index) with FAISS (Facebook AI Similarity Search). It uses the AG News dataset to generate text embeddings and evaluates search speed, memory consumption, and accuracy.
main.py: Downloads the AG News dataset and generatesembeddings.npyusingsentence-transformers.faiss_part.py: A standalone script to test FAISS indexing and search.turbovec_part.py: A standalone script to test TurboVec indexing and search.compare.py: Main Benchmarking Tool that runs both FAISS and TurboVec side-by-side and reports performance metrics.memory.py: Utility module for memory tracking and result comparison.requirements.txt: List of necessary Python dependencies.
- Clone this repository.
- Install the dependencies:
pip install -r requirements.txt
-
Generate Embeddings: Run
main.pyfirst to create theembeddings.npyfile:python main.py
-
Run Comparison: Run the comparison script to see the performance differences:
python compare.py
-
Individual Tests: You can also run
python faiss_part.pyorpython turbovec_part.pyindependently.
- Build Time: Time taken to index 100,000 vectors.
- Memory Used: Peak memory usage of the index structure.
- Search Time: Latency for a top-10 similarity search.
- Overlap: Accuracy of TurboVec compared to FAISS (Inner Product).