Skip to content

perf(vector/search): HNSW prefetch is x86_64 + aarch64 only; on wasm32 the search path takes a hit #657

Description

@mosuka

Round-3 perf push sub-issue (tracked under umbrella #536).

[S] HNSW prefetch is x86_64 + aarch64 only; on wasm32 the search path takes a hit

  • Where: laurus/src/vector/index/hnsw/searcher.rs:617-633#[cfg(target_arch = "x86_64")] / aarch64 blocks; wasm32 silently no-ops the inner branch.
  • Current behavior: WASM build runs the prefetch loop body for no benefit (just the
    HashMap lookup and an inner loop that does nothing).
  • Suggested direction: Wrap the entire prefetch pass behind #[cfg(not(target_arch = "wasm32"))]. Compile out the field_prefetch index entirely on WASM.
  • Risk / scope: Trivial. Just cfg gating.

ID: VS-14 — see ~/.claude/tasks/laurus/20260523_perf_round3_audit/task_list.md for the full Round-3 issue list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions