michaeljmarshall commented on code in PR #16620:
URL: https://github.com/apache/lucene/pull/16620#discussion_r3929130233


##########
lucene/core/src/java/org/apache/lucene/util/hnsw/InitializedHnswGraphBuilder.java:
##########
@@ -398,6 +452,7 @@ private void rebalanceGraph() throws IOException {
       Iterator<IntCursor> it = levelToNodes[level - 1].iterator();
 
       while (it.hasNext() && currentNodesAtLevel < maxNodesAtLevel) {
+        maybeAbort();

Review Comment:
   Nit: would it make more sense to only call this once we're in the below if 
block? The default value for `M` is 16, so we're likely to iterate several 
times before calling `addNode`. The cost is low since it's only a volatile 
read, but I mention it since the contract is to call before `addNode`.



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