jpountz commented on code in PR #14393:
URL: https://github.com/apache/lucene/pull/14393#discussion_r2010037158


##########
lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java:
##########
@@ -596,9 +606,12 @@ private IORunnable writeField1Dim(
       MutablePointTree reader)
       throws IOException {
     MutablePointTreeReaderUtils.sort(config, maxDoc, reader, 0, 
Math.toIntExact(reader.size()));
-
+    final int numLeaves =
+        Math.toIntExact(
+            (reader.size() + config.maxPointsInLeafNode() - 1) / 
config.maxPointsInLeafNode());
+    checkMaxLeafNodeCount(numLeaves);
     final OneDimensionBKDWriter oneDimWriter =
-        new OneDimensionBKDWriter(metaOut, indexOut, dataOut);
+        new OneDimensionBKDWriter(metaOut, indexOut, dataOut, new 
ArrayLongAccumulator(numLeaves));

Review Comment:
   Intuitively, there is ~512x (the leaf node size) more data than file 
pointers, so the bottleneck of flushing/merging should be on the data rather 
than on file pointers. So having small overhead on file pointers should be ok 
(hopefully benchmarks will confirm this).



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