File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
core/src/java/org/apache/lucene/codecs/lucene90 Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,8 @@ Improvements
52
52
(Robert Muir)
53
53
* GITHUB#13984: Add HNSW graph checks and stats to CheckIndex
54
54
55
+ * GITHUB#14113: Remove unnecessary ByteArrayDataInput allocations from `Lucene90DocValuesProducer$TermsDict.decompressBlock`. (Ankit Jain)
56
+
55
57
Optimizations
56
58
---------------------
57
59
Original file line number Diff line number Diff line change @@ -1122,10 +1122,9 @@ private class TermsDict extends BaseTermsEnum {
1122
1122
final LongValues indexAddresses ;
1123
1123
final RandomAccessInput indexBytes ;
1124
1124
final BytesRef term ;
1125
+ final BytesRef blockBuffer ;
1126
+ final ByteArrayDataInput blockInput ;
1125
1127
long ord = -1 ;
1126
-
1127
- BytesRef blockBuffer = null ;
1128
- ByteArrayDataInput blockInput = null ;
1129
1128
long currentCompressedBlockStart = -1 ;
1130
1129
long currentCompressedBlockEnd = -1 ;
1131
1130
@@ -1149,6 +1148,7 @@ private class TermsDict extends BaseTermsEnum {
1149
1148
// add 7 padding bytes can help decompression run faster.
1150
1149
int bufferSize = entry .maxBlockLength + entry .maxTermLength + LZ4_DECOMPRESSOR_PADDING ;
1151
1150
blockBuffer = new BytesRef (new byte [bufferSize ], 0 , bufferSize );
1151
+ blockInput = new ByteArrayDataInput ();
1152
1152
}
1153
1153
1154
1154
@ Override
@@ -1324,8 +1324,7 @@ private void decompressBlock() throws IOException {
1324
1324
}
1325
1325
1326
1326
// Reset the buffer.
1327
- blockInput =
1328
- new ByteArrayDataInput (blockBuffer .bytes , blockBuffer .offset , blockBuffer .length );
1327
+ blockInput .reset (blockBuffer .bytes , blockBuffer .offset , blockBuffer .length );
1329
1328
}
1330
1329
}
1331
1330
You can’t perform that action at this time.
0 commit comments