benwtrent commented on code in PR #15607:
URL: https://github.com/apache/lucene/pull/15607#discussion_r2743304756


##########
lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java:
##########
@@ -470,12 +476,18 @@ static void popToScratch(GraphBuilderKnnCollector 
candidates, NeighborArray scra
    */
   private boolean diversityCheck(float score, NeighborArray neighbors, 
RandomVectorScorer scorer)
       throws IOException {
+    int bulkCount = 0;
+    final int bulkScoreChunk = Math.min((neighbors.nodes().length + 1) / 2, 
bulkScoreNodes.length);

Review Comment:
   good call! And good call on the array copy!, Just needed to handle the tail. 
New benchmarks show even nicer perf ;)



-- 
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]

Reply via email to