benwtrent commented on code in PR #12820: URL: https://github.com/apache/lucene/pull/12820#discussion_r1419363698
########## lucene/core/src/java/org/apache/lucene/search/AbstractKnnCollector.java: ########## @@ -66,4 +69,19 @@ public final int k() { @Override public abstract TopDocs topDocs(); + + @Override + public void prepareScratchState(int maxDoc) { + if (visited == null) { + visited = new FixedBitSet(maxDoc + 1); + } else { + visited = FixedBitSet.ensureCapacity(visited, maxDoc); + visited.clear(); + } + } Review Comment: This is a bad idea, on very large graphs, since we scale logarithmically, sparsebitset would be much better. See: https://github.com/apache/lucene/pull/12789 -- 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