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 @@ -150,6 +150,8 @@ New Features

* GITHUB#14729: Support for Re-Ranking Queries using Late Interaction Model Multi-Vectors. (Vigya Sharma, Jim Ferenczi)

* GITHUB#15110: PostingsDecodingUtil: interchange loops to enable better memory access and SIMD vectorisation. (Ramakrishna Chilaka)

Improvements
---------------------
* GITHUB#14458: Add an IndexDeletion policy that retains the last N commits. (Owais Kazi)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,20 @@ public void decodeAndPrefixSum(Blackhole bh) throws IOException {
postingIn.decodeAndPrefixSum(bpv, 100, values);
bh.consume(values);
}

@Benchmark
@Fork(jvmArgsPrepend = {"--add-modules=jdk.incubator.vector"})
public void decodeVector(Blackhole bh) throws IOException {
in.seek(3); // random unaligned offset
postingIn.decode(bpv, values);
bh.consume(values);
}

@Benchmark
@Fork(jvmArgsPrepend = {"--add-modules=jdk.incubator.vector"})
public void decodeAndPrefixSumVector(Blackhole bh) throws IOException {
in.seek(3); // random unaligned offset
postingIn.decodeAndPrefixSum(bpv, 100, values);
bh.consume(values);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,21 @@ protected PostingDecodingUtil(IndexInput in) {
public void splitInts(
int count, int[] b, int bShift, int dec, int bMask, int[] c, int cIndex, int cMask)
throws IOException {
// Default implementation, which takes advantage of the C2 compiler's loop unrolling and
// auto-vectorization.
in.readInts(c, cIndex, count);
int maxIter = (bShift - 1) / dec;
for (int i = 0; i < count; ++i) {
for (int j = 0; j <= maxIter; ++j) {
b[count * j + i] = (c[cIndex + i] >>> (bShift - j * dec)) & bMask;
final int maxIter = (bShift - 1) / dec;

// Process each shift level across all elements (better for vectorization)
for (int j = 0; j <= maxIter; ++j) {
final int shift = bShift - j * dec;
final int bOffset = count * j;
// Vectorizable loop: contiguous memory access with simple operations
for (int i = 0; i < count; ++i) {
b[bOffset + i] = (c[cIndex + i] >>> shift) & bMask;
}
}

// Apply mask to c array (vectorizable)
for (int i = 0; i < count; ++i) {
c[cIndex + i] &= cMask;
}
}
Expand Down
Loading