<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/faster-knn-search-in-manticore-2-pass-hnsw-batched-distances-and-avx-512-w4vuktdoo" -->

---
title: Faster KNN search in Manticore: 2-pass HNSW, batched...
description: Three performance optimizations to Manticore Search's HNSW-based KNN engine deliver up to 29% throughput improvement at high k values, with 20%+ gains under...
canonical: https://daily.dev/posts/faster-knn-search-in-manticore-2-pass-hnsw-batched-distances-and-avx-512-w4vuktdoo
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Faster KNN search in Manticore: 2-pass HNSW, batched distances, and AVX-512 | daily.dev
og:description: Three performance optimizations to Manticore Search's HNSW-based KNN engine deliver up to 29% throughput improvement at high k values, with 20%+ gains under...
og:url: https://daily.dev/posts/faster-knn-search-in-manticore-2-pass-hnsw-batched-distances-and-avx-512-w4vuktdoo
og:image: https://api.daily.dev/og/posts/W4vUKTDoo.png
og:image:alt: Faster KNN search in Manticore: 2-pass HNSW, batched distances, and AVX-512
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Faster KNN search in Manticore: 2-pass HNSW, batched distances, and AVX-512

**[Manticore](https://daily.dev/sources/manticoresearch)** · 8 min read · 0 upvotes · 0 comments

## Summary

Three performance optimizations to Manticore Search's HNSW-based KNN engine deliver up to 29% throughput improvement at high k values, with 20%+ gains under concurrent load. The changes include: compile-time distance function specialization via C++ templates (eliminating indirect call overhead), a 2-pass neighbor processing loop that issues CPU prefetch hints before distance computation, and batched distance scoring that reuses the query vector across two candidates per SIMD iteration. Additionally, AVX-512 support was added, processing 16 floats per iteration vs. 8 with AVX2, with automatic CPU detection at startup. No API changes, index rebuilds, or configuration are required — improvements ship in Manticore Search 27.1.5.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://manticoresearch.com/blog/knn-hnsw-performance>

## Questions this post answers

### How much faster is KNN search in Manticore Search 27.1.5 compared to the previous version?

Up to 29% faster at high k values (k=1000) on a single thread, with 22-24% gains at k=1000 across multi-threaded workloads, when comparing the AVX-512 build with the new optimizations against the previous AVX2 build. Gains are smaller at low k, starting around +0.5% at k=10, because low-k queries spend more time on graph traversal than distance computation.

_Developers tuning vector search performance can track engine-level benchmarks like these on daily.dev._

### Do I need to rebuild my Manticore Search indexes to get the new HNSW performance improvements?

No, the optimizations require no index rebuild, no API changes, and no configuration changes. Manticore Search 27.1.5 automatically detects CPU capabilities at startup and loads the appropriate library variant (baseline, AVX2, or AVX-512), so existing deployments benefit immediately after upgrading.

_daily.dev helps engineers stay on top of upgrade notes like this before rolling out a new database version._

### What is 2-pass neighbor processing in HNSW vector search?

It is a technique that splits neighbor processing into two passes instead of one: pass one collects unvisited neighbors into a batch array and issues memory prefetch hints for their vector data, while pass two iterates the batch to compute distances once the prefetched data has arrived in cache. This reduces memory stalls and enables batching distance computations two candidates at a time.

_Engineers optimizing search infrastructure can find deep technical breakdowns like this via daily.dev._

## Similar posts on daily.dev

- [Faster KNN index builds in Manticore](https://daily.dev/posts/faster-knn-index-builds-in-manticore-bjesanict) · Manticore · 0 upvotes · 0 comments
- [KNN early termination in Manticore Search](https://daily.dev/posts/knn-early-termination-in-manticore-search-ubrsu52i4) · Manticore · 0 upvotes · 1 comments
- [HNSW vs LSH: How Elasticsearch hits 0.99 recall@10 at 15,000 QPS — and what it costs](https://daily.dev/posts/hnsw-vs-lsh-how-elasticsearch-hits-0-99-recall-10-at-15-000-qps-and-what-it-costs-sbqrpbp3z) · elastic · 0 upvotes · 0 comments
- [KNN prefiltering in Manticore Search](https://daily.dev/posts/knn-prefiltering-in-manticore-search-7jckzmf7r) · Manticore · 0 upvotes · 0 comments

---

Tags: [#deep-learning](https://daily.dev/tags/deep-learning), [#vector-search](https://daily.dev/tags/vector-search), [#manticore-search](https://daily.dev/tags/manticore-search)

[View this post on daily.dev](https://daily.dev/posts/faster-knn-search-in-manticore-2-pass-hnsw-batched-distances-and-avx-512-w4vuktdoo)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Faster KNN search in Manticore: 2-pass HNSW, batched distances, and AVX-512","url":"https://daily.dev/posts/faster-knn-search-in-manticore-2-pass-hnsw-batched-distances-and-avx-512-w4vuktdoo","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/faster-knn-search-in-manticore-2-pass-hnsw-batched-distances-and-avx-512-w4vuktdoo"},"datePublished":"2026-07-09T07:50:02.905Z","dateModified":"2026-09-14T07:01:19.928Z","description":"Three performance optimizations to Manticore Search's HNSW-based KNN engine deliver up to 29% throughput improvement at high k values, with 20%+ gains under...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/2d42aed3e06d007f01825550b55606da?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/2d42aed3e06d007f01825550b55606da?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Manticore","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Manticore","logo":"https://media.daily.dev/image/upload/s--FP5Ea08h--/f_auto/v1754225081/logos/manticoresearch","url":"https://daily.dev/sources/manticoresearch"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/faster-knn-search-in-manticore-2-pass-hnsw-batched-distances-and-avx-512-w4vuktdoo","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"deep-learning,vector-search,manticore-search","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Manticore","item":"https://daily.dev/sources/manticoresearch"},{"@type":"ListItem","position":3,"name":"Faster KNN search in Manticore: 2-pass HNSW, batched distances, and AVX-512"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/faster-knn-search-in-manticore-2-pass-hnsw-batched-distances-and-avx-512-w4vuktdoo#faq","mainEntity":[{"@type":"Question","name":"How much faster is KNN search in Manticore Search 27.1.5 compared to the previous version?","acceptedAnswer":{"@type":"Answer","text":"Up to 29% faster at high k values (k=1000) on a single thread, with 22-24% gains at k=1000 across multi-threaded workloads, when comparing the AVX-512 build with the new optimizations against the previous AVX2 build. Gains are smaller at low k, starting around +0.5% at k=10, because low-k queries spend more time on graph traversal than distance computation. Developers tuning vector search performance can track engine-level benchmarks like these on daily.dev."}},{"@type":"Question","name":"Do I need to rebuild my Manticore Search indexes to get the new HNSW performance improvements?","acceptedAnswer":{"@type":"Answer","text":"No, the optimizations require no index rebuild, no API changes, and no configuration changes. Manticore Search 27.1.5 automatically detects CPU capabilities at startup and loads the appropriate library variant (baseline, AVX2, or AVX-512), so existing deployments benefit immediately after upgrading. daily.dev helps engineers stay on top of upgrade notes like this before rolling out a new database version."}},{"@type":"Question","name":"What is 2-pass neighbor processing in HNSW vector search?","acceptedAnswer":{"@type":"Answer","text":"It is a technique that splits neighbor processing into two passes instead of one: pass one collects unvisited neighbors into a batch array and issues memory prefetch hints for their vector data, while pass two iterates the batch to compute distances once the prefetched data has arrived in cache. This reduces memory stalls and enables batching distance computations two candidates at a time. Engineers optimizing search infrastructure can find deep technical breakdowns like this via daily.dev."}}]}
```

