Skip to content

perf(vector/index): eliminate field_index: HashMap<String, ...> lookup hash on every NRT query #642

Description

@mosuka

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

[S] Eliminate field_index: HashMap<String, ...> lookup hash on every NRT query

  • Where: laurus/src/vector/index/quantized_storage.rs:127-129
    (field_position_index clones an Arc but the first lookup still
    hashes the String); same in pq_storage.rs:113-115.
  • Current behaviour: NRT path hashes the field name string per
    query; with sub-microsecond distance kernels, this is now a measurable
    fraction.
  • Suggested direction: cache the (field_name, field_id) mapping
    in the searcher itself (one lookup at HnswSearcher / IvfSearcher
    construction). Pair with Fix fuzzy query example #8 + Fix wildcard query #14 to make the field_id the only
    identity carried inside the pool.
  • Risk / scope: trivial.


ID: VI-24 — 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