You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/02/03 05:32:20 UTC
[GitHub] [lucene] jtibshirani commented on a change in pull request #641: LUCENE-10391: Reuse data structures across HnswGraph#searchLevel calls
jtibshirani commented on a change in pull request #641:
URL: https://github.com/apache/lucene/pull/641#discussion_r798223589
##########
File path: lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraph.java
##########
@@ -93,6 +94,29 @@
}
}
+ /**
+ * Holds data structures that are used by each {@link #searchLevel} call. These can be expensive
+ * to allocate, so whenever possible they're cleared and reused across calls.
+ */
+ static class HnswSearchState {
+ final NeighborQueue candidates;
Review comment:
I didn't include the `results` queue because it's typically a lot smaller and I thought it made the logic less clear (results are returned but also passed in as scratch state?)
--
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