mirror of https://github.com/apache/lucene.git
Avoid duplicate array fill in BPIndexReorderer (#12645)
This commit is contained in:
parent
4f01de2a2d
commit
65d2227f83
|
@ -178,7 +178,7 @@ Optimizations
|
|||
|
||||
* GITHUB#12623: Use a MergeSorter taking advantage of extra storage for StableMSBRadixSorter. (Guo Feng)
|
||||
|
||||
* GITHUB#12623: Write MSB VLong for better outputs sharing in block tree index, decreasing ~14% size
|
||||
* GITHUB#12631: Write MSB VLong for better outputs sharing in block tree index, decreasing ~14% size
|
||||
of .tip file. (Guo Feng)
|
||||
|
||||
Changes in runtime behavior
|
||||
|
|
|
@ -293,9 +293,7 @@ public final class BPIndexReorderer {
|
|||
int[] leftDocFreqs = state.leftDocFreqs;
|
||||
int[] rightDocFreqs = state.rightDocFreqs;
|
||||
|
||||
Arrays.fill(leftDocFreqs, 0);
|
||||
computeDocFreqs(left, forwardIndex, leftDocFreqs);
|
||||
Arrays.fill(rightDocFreqs, 0);
|
||||
computeDocFreqs(right, forwardIndex, rightDocFreqs);
|
||||
|
||||
for (int iter = 0; iter < maxIters; ++iter) {
|
||||
|
@ -921,7 +919,7 @@ public final class BPIndexReorderer {
|
|||
}
|
||||
|
||||
/** An approximate log() function in base 2 which trades accuracy for much better performance. */
|
||||
static final float fastLog2(int i) {
|
||||
static float fastLog2(int i) {
|
||||
assert i > 0 : "Cannot compute log of i=" + i;
|
||||
// floorLog2 would be the exponent in the float representation of i
|
||||
int floorLog2 = 31 - Integer.numberOfLeadingZeros(i);
|
||||
|
|
Loading…
Reference in New Issue