Round-3 perf push sub-issue (tracked under umbrella #536).
[S] Vec<Candidate> heap allocation grows on graph traversal — pre-size to ef_search
- Where:
hnsw/searcher.rs:419-420 — BinaryHeap::new() × 2 with no with_capacity.
- Current behavior: Heaps grow geometrically on push, reallocating O(log N) times.
- Suggested direction:
BinaryHeap::with_capacity(ef_search * 2) for the result heap;
candidate heap can be sized similarly.
- Risk / scope: Trivial.
ID: VS-37 — 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]
Vec<Candidate>heap allocation grows on graph traversal — pre-size to ef_searchhnsw/searcher.rs:419-420—BinaryHeap::new()× 2 with nowith_capacity.BinaryHeap::with_capacity(ef_search * 2)for the result heap;candidate heap can be sized similarly.
ID:
VS-37— see~/.claude/tasks/laurus/20260523_perf_round3_audit/task_list.mdfor the full Round-3 issue list.