Improve the initial allocation size of LongHeap [LUCENE-9846]
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
Today `LongHeap.push/ArrayUtil.grow` is apparently a hot spot. Can we predict the correct maximum size better? It seems likely this is due to the candidates queue in `HnswGraph.search` which is the only place where these heaps are used that can extend their size.
---
Migrated from [LUCENE-9846](https://issues.apache.org/jira/browse/LUCENE-9846) by Michael Sokolov (@msokolov)
Contributor guide
Research direction
Start by tracing LongHeap.push and ArrayUtil.grow, then inspect the candidates queue in HnswGraph.search, identified as the heap usage that can extend its size. Determine how its maximum size could be predicted for a better initial allocation. Done means reducing unnecessary growth for that queue while preserving heap behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- search
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100