zhaih commented on code in PR #12660:
URL: https://github.com/apache/lucene/pull/12660#discussion_r1367984559


##########
lucene/core/src/java/org/apache/lucene/codecs/lucene95/Lucene95HnswVectorsWriter.java:
##########
@@ -635,17 +667,31 @@ private static DocsWithFieldSet writeVectorData(
     return docsWithField;
   }
 
+  private HnswGraphMerger createGraphMerger(
+      FieldInfo fieldInfo, RandomVectorScorerSupplier scorerSupplier) {
+    if (exec != null) {
+      return new ConcurrentHnswMerger(
+          fieldInfo, scorerSupplier, M, beamWidth, exec, numMergeWorkers);
+    }
+    return new IncrementalHnswGraphMerger(fieldInfo, scorerSupplier, M, 
beamWidth);
+  }
+
   @Override
   public void close() throws IOException {
     IOUtils.close(meta, vectorData, vectorIndex);
+    if (exec != null) {
+      exec.shutdownNow();
+    }
+    System.out.println(
+        "Total contention time: " + NeighborArray.contentionTime.get() / 
1000000 + " ms");

Review Comment:
   > Almost 1/3 of the time spent waiting for locks!
   
   I don't think so? the 5000 ms is the cpu time and 17k ms is wall time, so 
roughly if we divide the 5000ms into 8 then it's about 4~5% of total wall time 
spent in waiting. 



-- 
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-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to