You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "kkewwei (via GitHub)" <gi...@apache.org> on 2026/10/01 14:15:26 UTC

[PR] Speed up building cached bit sets in LRUQueryCache [lucene]

kkewwei opened a new pull request, #16757:
URL: https://github.com/apache/lucene/pull/16757

   ### Description
   
   `LRUQueryCache` currently consumes `DocIdStream` through a temporary `int[]` buffer and sets matching documents individually. For `BitSetDocIdStream`, this unnecessarily converts a bit set into doc IDs and then back into another bit set.
   
   This change adds a package-private `BitSetDocIdStream#orInto` method that merges the remaining documents directly into the cache's `FixedBitSet` using `FixedBitSet.orRange`. we also retain the existing per-document fallback for other `DocIdStream` implementations, it seems that normal collection paths never reach this per-doc.
   


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Speed up building cached bit sets in LRUQueryCache [lucene]

Posted by "sgup432 (via GitHub)" <gi...@apache.org>.
sgup432 commented on PR #16757:
URL: https://github.com/apache/lucene/pull/16757#issuecomment-6276641571

   @kkewwei Thanks for this change, a must needed but I have few questions/comments on how it is implemented:
   1. Firstly, I think it would be better to introduce the API on the base class ie DocIdStream so other implementation can override if they want. Keeping per doc evaluation as default. Also having naming the API as something like `intoBitSet` similar to what we have in `DocIdIterator`.
   2. Secondly, I see all the other APIs on DocIdStream have two variants, with and without `upTo` parameter where the caller can either collect all docs at once or maybe split it depending on the usecase. `intoBitSet(int upTo, FixedBitSet bitSet, int offset)`
   
   I would like to get opinions from others on this as to what they think. @romseygeek Can you help here?
   
   


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Speed up building cached bit sets in LRUQueryCache [lucene]

Posted by "kkewwei (via GitHub)" <gi...@apache.org>.
kkewwei commented on PR #16757:
URL: https://github.com/apache/lucene/pull/16757#issuecomment-6288994045

   @sgup432 Thank you very much for the review. 
   
   About the second point, I think it would be better for`intoBitSet` to accept an`upTo`, for consistency with`intoBitSet` in other classes.


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Speed up building cached bit sets in LRUQueryCache [lucene]

Posted by "kkewwei (via GitHub)" <gi...@apache.org>.
kkewwei commented on PR #16757:
URL: https://github.com/apache/lucene/pull/16757#issuecomment-6051385952

   @sgup432 Would you mind have a look in your spare time? Very thank you.


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Speed up building cached bit sets in LRUQueryCache [lucene]

Posted by "github-actions[bot] (via GitHub) via issues" <is...@lucene.apache.org>.
github-actions[bot] commented on PR #16757:
URL: https://github.com/apache/lucene/pull/16757#issuecomment-6699500093

   This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the dev@lucene.apache.org list. Thank you for your contribution!


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org