You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "iprithv (via GitHub)" <gi...@apache.org> on 2026/05/18 08:02:12 UTC

[PR] add FixedBitSet.nextUnsetBit and use it in MergingHnswGraphBuilder [lucene]

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

   there was a TODO in MergingHnswGraphBuilder.build() where we were scanning all nodes even if most were already initialized, this change adds nextUnsetBit and uses that instead, so we only go over nodes that are not set, instead of checking every node, we just jump to the next unset one. 
   
   so earlier it goes through all nodes and check each one, now jump directly to next unset bit.
   this is faster when most bits are already set, which is common during merges
   
   benchmark (bitset iteration)
   
   | size      | set % | scan loop (us) | nextUnsetBit (us) | speedup |
   |-----------|-------|----------------|-------------------|---------|
   | 1,000     | 0%    | 8.76           | 11.89             | slower  |
   | 1,000     | 75%   | 2.27           | 1.25              | ~1.8x   |
   | 1,000     | 90%   | 2.30           | 0.54              | ~4.2x   |
   | 1,000     | 99%   | 2.24           | 0.06              | ~35x    |
   | 100,000   | 75%   | 217            | 82.3              | ~2.6x   |
   | 100,000   | 90%   | 218            | 33.4              | ~6.5x   |
   | 100,000   | 99%   | 215            | 4.69              | ~45x    |
   | 1,000,000 | 99%   | 2157           | 43.3              | ~49x    |
   
   
   luceneutil (real run)
   
   |              | baseline | candidate | result |
   |--------------|----------|-----------|--------|
   | force merge  | 220.11s  | 218.68s   | same   |
   | index time   | 224.73s  | 229.25s   | same   |
   | recall       | 0.988    | 0.988     | same   |


-- 
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] add FixedBitSet.nextUnsetBit and use it in MergingHnswGraphBuilder [lucene]

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

   thanks @iverase for pointing out, will close this. As that was merged just now i missed it :)


-- 
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] add FixedBitSet.nextUnsetBit and use it in MergingHnswGraphBuilder [lucene]

Posted by "iprithv (via GitHub)" <gi...@apache.org>.
iprithv closed pull request #16079: add FixedBitSet.nextUnsetBit and use it in MergingHnswGraphBuilder
URL: https://github.com/apache/lucene/pull/16079


-- 
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] add FixedBitSet.nextUnsetBit and use it in MergingHnswGraphBuilder [lucene]

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

   see https://github.com/apache/lucene/pull/16072


-- 
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