Skip to content

perf(vector/search): HNSW reader keeps vector_ids: Vec<(u64, String)> alongside vector_ids_by_field #682

Description

@mosuka

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

[M] HNSW reader keeps vector_ids: Vec<(u64, String)> alongside vector_ids_by_field

  • Where: laurus/src/vector/index/hnsw/reader.rs:46,71,560.
  • Current behavior: Held as Vec<(u64, String)> (~32 B / entry) duplicated alongside
    the per-field index Arc<[u64]> (perf(vector): cache vector_ids per field at reader load #405). Double storage.
  • Why it might be a bottleneck / risk: Memory only; ~320 MB on 10 M-vector indexes
    wasted because all access goes through vector_ids_by_field now.
  • Suggested direction: Drop vector_ids: Vec<(u64, String)>; reconstruct on demand
    from vector_ids_by_field (already grouped). Or keep only a Vec<u64> per field with
    the field index implicit.
  • Risk / scope: Small.

ID: VS-39 — 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