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/06/23 13:45:56 UTC

[GitHub] [lucene] alessandrobenedetti commented on a diff in pull request #926: VectorSimilarityFunction reverse removal

alessandrobenedetti commented on code in PR #926:
URL: https://github.com/apache/lucene/pull/926#discussion_r905042674


##########
lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java:
##########
@@ -246,7 +246,7 @@ private boolean diversityCheck(
     for (int i = 0; i < neighbors.size(); i++) {
       float neighborSimilarity =
           similarityFunction.compare(candidate, vectorValues.vectorValue(neighbors.node[i]));
-      if (neighborSimilarity >= score) {

Review Comment:
   Yesterday myself and 2 of our engineers spent literally 3 hours discussing and testing this, isolating the instruction that was causing  this branch to go slower than the upstream/main .
   We ended up with this single change bringing a lot of improvement (and it's in line with what the BoundChecker was doing).
   
   We isolated the problem and solution there, but we couldn't find a specific Java reason.
   We were wondering if the equality check on top of the "greater than" may result in additional expense when closer vectors are present?



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