This patch introduces BOOST iterator - a substantial block for efficient and high-quality symbol retrieval. The concept of boosting allows performing computationally inexpensive scoring on the query side so that the final (expensive) scoring can only be applied on the items with the highest preliminary score while eliminating the need to score too many items.
Details
Diff Detail
Event Timeline
clang-tools-extra/clangd/index/dex/Iterator.h | ||
---|---|---|
92 | Maybe add a note to the comment on why an ID parameter actually is here? | |
140 | Could we describe the rationale for keeping both consume and consumeAndBoost somewhere in the comments? From the offline conversation, it seems consumeAndBoost is more expensive, but our clients will all use it at some point in the future. | |
166 | Maybe use float scores to align with the scoring code we have for completion? |
- Add more comments explaining the difference between consume() and consumeAndBoost() and their potential usecases for the clients
- Move DEFAULT_BOOSTING_SCORE to the header by making it constexpr and change its type to float
Summarizing the offline discussion with @kbobyrev, @ioeric and @sammccall in two comments.
clang-tools-extra/clangd/index/dex/Iterator.h | ||
---|---|---|
96 | With limit iterator in mind, let's rename this to consume() and make it non-const. | |
144 | Let's remove this function and change the interface of consume to return a vector of pairs instead. |
Maybe add a note to the comment on why an ID parameter actually is here?
IIUC, we need to because various iterators in the tree may point to different elements and we need to know which one we've actually matched.