Benchmark: Brute force outperforms HNSW at 5,183 documents
thehuhcoder · reddit · 2026-08-27
The author implemented HNSW from scratch and benchmarked it against FAISS. Surprisingly, at a scale of 5,000 documents, the pure Python HNSW was significantly slower than brute force search, and even lagged behind FAISS's HNSW, with a much higher graph build cost. The analysis suggests that for small datasets, the dense matrix multiplication of exact search is so fast that the pointer chasing of graph structures becomes overhead. The post also notes that query encoding takes much longer than retrieval, and that RRF fusion of BM25 and dense retrieval provides significant quality gains.
More from Infra
- OpenAI reveals AI-assisted chip design, accelerating development of first-gen chip — AccBalanced · 2026-08-27
- Node for truly free model and node cache in Stable Diffusion — JustLookingForNothin · 2026-08-27
- Redis creator Antirez commits to non-profit local inference engine — antirez · 2026-08-27
- Gemma 4 31B hits 3,431 tokens/s on NVIDIA Groq 3 — GlennCameronjr · 2026-08-27
- Nativ adds GLM-5.3 support: 505 tok/s on M3 Ultra — lllucas · 2026-08-27
- DeepInfra launches GLM-5.3-Flash and Zai's 320B model — gharik · 2026-08-27