Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lucene/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ Optimizations

* GITHUB#15729: Lucene90DocValuesProducer is not prefetching any data for DocValueSkippers anymore (Alexander Reelsen)

* GITHUB#15772: improve BytesRefHash.sort performance by rearranging ids#15772 (tyronecai)

* GITHUB#15742: Optimize int4 dotProduct and squareDistance computations by replacing vector conversions with reinterpret casting + bit manipulation. (Trevor McCulloch, Kaival Parikh)

Bug Fixes
Expand Down
15 changes: 5 additions & 10 deletions lucene/core/src/java/org/apache/lucene/util/BytesRefHash.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,13 @@ public BytesRef get(int bytesID, BytesRef ref) {
*/
public int[] compact() {
assert bytesStart != null : "bytesStart is null - not initialized";
int upto = 0;
for (int i = 0; i < hashSize; i++) {
if (ids[i] != -1) {
ids[upto] = ids[i] & hashMask;
if (upto < i) {
ids[i] = -1;
}
upto++;
}

// id is the sequence number when bytes added to the pool
for (int i = 0; i < count; i++) {
ids[i] = i;
}
Arrays.fill(ids, count, hashSize, -1);

assert upto == count;
lastCount = count;
return ids;
}
Expand Down
Loading