ML-dev-crypto commented on code in PR #15667:
URL: https://github.com/apache/lucene/pull/15667#discussion_r2774083977


##########
lucene/core/src/java/org/apache/lucene/util/hnsw/NeighborArray.java:
##########
@@ -310,21 +310,47 @@ private boolean isWorstNonDiverse(
     float minAcceptedSimilarity = scores.get(candidateIndex);
     if (candidateIndex == uncheckedIndexes[uncheckedCursor]) {
       // the candidate itself is unchecked
-      for (int i = candidateIndex - 1; i >= 0; i--) {

Review Comment:
   THANKS FOR YOUR GUIDANCE AND TIME.Right now this PR removes the dominant 
allocation by reusing the float[] in the hot path. There is still a small int[] 
allocation when gathering unchecked nodes, which could be avoided by passing 
both int[] and float[] or by using DocAndFloatFeatureBuffer.
   I kept this PR minimal and behavior-preserving, but I’m happy to extend it 
to reuse both buffers if you’d prefer that in this change.
   



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