iprithv commented on code in PR #15978:
URL: https://github.com/apache/lucene/pull/15978#discussion_r3139821239


##########
lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java:
##########
@@ -205,15 +205,27 @@ protected void addVectors(int minOrd, int maxOrd) throws 
IOException {
       throw new IllegalStateException("This HnswGraphBuilder is frozen and 
cannot be updated");
     }
     long start = System.nanoTime(), t = start;
-    if (infoStream.isEnabled(HNSW_COMPONENT)) {
-      infoStream.message(HNSW_COMPONENT, "addVectors [" + minOrd + " " + 
maxOrd + ")");
-    }
+    int numVectors = maxOrd - minOrd;
     for (int node = minOrd; node < maxOrd; node++) {
       addGraphNode(node);
-      if ((node % 10000 == 0) && infoStream.isEnabled(HNSW_COMPONENT)) {
+      // Skip in-loop progress for ranges <= 10000 where it would fire at most 
once
+      // with identical incremental/total times (#15967).
+      if (numVectors > 10000 && (node % 10000 == 0) && 
infoStream.isEnabled(HNSW_COMPONENT)) {

Review Comment:
   Sure, updated.
   
   1. Kept the node % 10000 for all ranges (removed the numVectors > 10000 
guard)
   2. Dropped the delta time, now just shows elapsed time since start: "built 
%d in %.2f ms"
   3. For concurrent merges, it'll now show time since merge start (not chunk 
start). Added a mergeStartTimeNS field that HnswConcurrentMergeBuilder.build() 
sets on all workers before launching them. For the non-concurrent build() path, 
it falls back to chunk-local start time (which is the same as build start).



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