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