← All questions
Retrieval & EmbeddingsMedium· HNSW· Performance Tuning· Latency

Your HNSW index is at 6ms latency with a 20ms budget an...

Layer 0 dominates the search latency, so increasing ef (e.g., from 64 to 128) is a reversible, per-request adjustment that typically fits within the remaining latency budget. If recall stops improving, the graph connectivity (M) is likely the bottleneck. Increasing M improves recall but adds significant memory overhead, which must be priced out in terms of gigabytes per vector.

Code playground (Python)