shubhamvishu commented on code in PR #14963:
URL: https://github.com/apache/lucene/pull/14963#discussion_r2380377256
##########
lucene/core/src/java/org/apache/lucene/codecs/lucene99/Lucene99HnswVectorsWriter.java:
##########
@@ -575,16 +612,27 @@ static int distFuncToOrd(VectorSimilarityFunction func) {
throw new IllegalArgumentException("invalid distance function: " + func);
}
+ private static boolean shouldCreateGraph(int k, int numNodes) {
+ int expectedVisitedNodes =
+ expectedVisitedNodes(k, numNodes); // k is typically small, so this is
cheap
+ return numNodes > expectedVisitedNodes;
Review Comment:
One thing to note: the nice improvement we saw in benchmarks was with
`expectedVisitedNodes(k, numNodes) * 10`, so that the nodes threshold is at
least 1 order higher than what `expectedVisitedNode` returns. I don't expect
this to change the luceneutil numbers but still something to keep in mind. We
could confirm with another run if this is not having any negative impact on
performance numbers.
--
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]