From b228b2efd959539161667ece72fe91ddb03c2553 Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Mon, 21 Jul 2025 18:09:25 +0200 Subject: [PATCH] Change the ef construction from default 100 to 33 --- Cargo.lock | 2 +- crates/milli/Cargo.toml | 2 +- crates/milli/src/vector/mod.rs | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9f75dd281..30bd2e957 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2581,7 +2581,7 @@ dependencies = [ [[package]] name = "hannoy" version = "0.7.0" -source = "git+https://github.com/nnethercott/hannoy?branch=incremental-indexing#364f611b10642ad34a3466b80dc687d1114bda4f" +source = "git+https://github.com/kerollmops/hannoy?branch=expose-private-types#98c7adda0d96a9f98203797d24c26a4de06cab3e" dependencies = [ "bytemuck", "byteorder", diff --git a/crates/milli/Cargo.toml b/crates/milli/Cargo.toml index e6641e07c..e18e13935 100644 --- a/crates/milli/Cargo.toml +++ b/crates/milli/Cargo.toml @@ -87,7 +87,7 @@ rhai = { version = "1.22.2", features = [ "no_time", "sync", ] } -hannoy = { git = "https://github.com/nnethercott/hannoy", branch = "incremental-indexing" } +hannoy = { git = "https://github.com/kerollmops/hannoy", branch = "expose-private-types" } rand = "0.8.5" tracing = "0.1.41" ureq = { version = "2.12.1", features = ["json"] } diff --git a/crates/milli/src/vector/mod.rs b/crates/milli/src/vector/mod.rs index 6ce0831b0..5414526ae 100644 --- a/crates/milli/src/vector/mod.rs +++ b/crates/milli/src/vector/mod.rs @@ -147,7 +147,7 @@ impl HannoyWrapper { if self.quantized { let writer = hannoy::Writer::new(self.quantized_db(), index, dimension); if writer.need_build(wtxn)? { - writer.builder(rng).build::<16, 32>(wtxn)? + writer.builder(rng).ef_construction(33).build::<16, 32>(wtxn)? } else if writer.is_empty(wtxn)? { continue; } @@ -173,6 +173,7 @@ impl HannoyWrapper { .available_memory(hannoy_memory.unwrap_or(usize::MAX)) // .progress(|step| progress.update_progress_from_hannoy(step)) // .cancel(cancel) + .ef_construction(33) .build::<16, 32>(wtxn)?; } else if writer.is_empty(wtxn)? { continue;