Round-3 perf push sub-issue (tracked under umbrella #536).
[S] HNSW id_to_index: AHashMap<u64, usize> — usize is 8 bytes when u32 would suffice
- Where:
laurus/src/vector/index/hnsw/graph.rs:21 —
id_to_index: AHashMap<u64, usize>.
- Current behavior: Two pointer-width values per entry, 24 bytes including HashMap
overhead.
- Suggested direction:
AHashMap<u64, u32> (or IntMap after a nohash switch).
Saves 4 bytes / entry; at 10 M nodes that's 40 MB.
- Risk / scope: Trivial.
u32::try_from(...).expect("doc id fits in u32") shim.
ID: VS-38 — see ~/.claude/tasks/laurus/20260523_perf_round3_audit/task_list.md for the full Round-3 issue list.
Round-3 perf push sub-issue (tracked under umbrella #536).
[S] HNSW
id_to_index: AHashMap<u64, usize>—usizeis 8 bytes when u32 would sufficelaurus/src/vector/index/hnsw/graph.rs:21—id_to_index: AHashMap<u64, usize>.overhead.
AHashMap<u64, u32>(orIntMapafter anohashswitch).Saves 4 bytes / entry; at 10 M nodes that's 40 MB.
u32::try_from(...).expect("doc id fits in u32")shim.ID:
VS-38— see~/.claude/tasks/laurus/20260523_perf_round3_audit/task_list.mdfor the full Round-3 issue list.