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: [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]
