john-wagster commented on code in PR #14836:
URL: https://github.com/apache/lucene/pull/14836#discussion_r2161776441


##########
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:
   might be worth a comment on this?  I think I roughly follow that we use a 
FixedBitSet when the log of the graph size * k < graph size / 128, but wasn't 
quite sure about the intuition 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-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

Reply via email to