costin commented on code in PR #16849:
URL: https://github.com/apache/lucene/pull/16849#discussion_r4296913917
##########
lucene/core/src/java/org/apache/lucene/util/BitSetIterator.java:
##########
@@ -96,12 +99,18 @@ public long cost() {
@Override
public int docIDRunEnd() {
assert doc != NO_MORE_DOCS;
- int next = doc + 1;
- if (next >= length) {
- return length;
+ // Called once per window by DenseConjunctionBulkScorer: resume from the
known run end and
+ // bound the scan, otherwise a long run is rescanned on every call, which
is quadratic.
+ if (doc < runStart || doc >= runEnd) {
Review Comment:
Improved the javadoc and `setDocId` to also resets the cache.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]