perf(fts): add block-max skip and score early-exit to ConjunctionIterator#441
Open
egolearner wants to merge 1 commit into
Open
perf(fts): add block-max skip and score early-exit to ConjunctionIterator#441egolearner wants to merge 1 commit into
egolearner wants to merge 1 commit into
Conversation
- Block-max skip: skip entire non-competitive blocks (128 docs) in do_next() by checking block_max_info_for() score upper bounds - Score early-exit: short-circuit score() accumulation when remaining upper bound cannot beat the threshold - Phrase forwarding: PhraseDocIterator propagates min_competitive_score to its inner conjunction, enabling the above optimizations for phrase queries - optIsRequired: when must-only block_max < threshold, promote should clauses to required so docs without any should match are skipped - DisjunctionIterator::advance() bypasses the WAND loop to avoid incorrectly pruning target docs when used as a should clause Benchmark (500k docs, quora dataset, BitPacked mode): AND queries: 22-38% faster (topk=10: 3.65s→2.86s, topk=3: 3.63s→2.26s) Phrase queries: 33% faster (205s→137s)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Benchmark (500k docs, quora dataset, BitPacked mode):
AND queries: 22-38% faster (topk=10: 3.65s→2.86s, topk=3: 3.63s→2.26s)
Phrase queries: 33% faster (205s→137s)