From ecce083c5017576f552a5fd8e347b8748dbc0db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20B=C3=BCscher?= Date: Tue, 27 Nov 2018 17:41:58 +0100 Subject: [PATCH] LUCENE-8573: Use FutureArrays#mismatch in BKDWriter Closes #510 Signed-off-by: Adrien Grand --- lucene/CHANGES.txt | 5 ++ .../org/apache/lucene/util/bkd/BKDWriter.java | 60 +++++++++---------- 2 files changed, 32 insertions(+), 33 deletions(-) diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index 86d06bc8329..a8e100a3bd4 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -233,6 +233,11 @@ Optimizations * LUCENE-8552: FieldInfos.getMergedFieldInfos no longer does any merging if there is <= 1 segment. (Christophe Bismuth via David Smiley) +Other + +* LUCENE-8573: BKDWriter now uses FutureArrays#mismatch to compute shared prefixes. + (Christoph Büscher via Adrien Grand) + ======================= Lucene 7.6.0 ======================= Build diff --git a/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java b/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java index 1ffa27542e6..39d05b0b5d5 100644 --- a/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java +++ b/lucene/core/src/java/org/apache/lucene/util/bkd/BKDWriter.java @@ -678,13 +678,10 @@ public class BKDWriter implements Closeable { checkMaxLeafNodeCount(leafBlockFPs.size()); // Find per-dim common prefix: - int prefix = bytesPerDim; int offset = (leafCount - 1) * packedBytesLength; - for(int j=0;j