benwtrent commented on code in PR #14836: URL: https://github.com/apache/lucene/pull/14836#discussion_r2161790605
########## lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphSearcher.java: ########## @@ -41,6 +41,16 @@ public class HnswGraphSearcher extends AbstractHnswGraphSearcher { protected BitSet visited; + public static int expectedVisitedNodes(int k, int graphSize) { + return (int) (Math.log(graphSize) * k); + } + + static BitSet createBitSet(int k, int graphSize) { + return expectedVisitedNodes(k, graphSize) < (graphSize >>> 7) ? Review Comment: yeah, I will add some java docs. The `>>> 7` is a standard thing elsewhere and I will link 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-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org