mirror of https://github.com/apache/lucene.git
LUCENE-10366: Override #readVInt and #readVLong for ByteBufferDataInput to avoid the abstraction confusion of #readByte. (#592)
This commit is contained in:
parent
c746bea233
commit
ed7c78ce6d
|
@ -205,6 +205,8 @@ Improvements
|
|||
Optimizations
|
||||
---------------------
|
||||
|
||||
* LUCENE-10366: Override readVInt() and readVLong() in ByteBufferDataInput to help Hotspot inline method. (Guo Feng)
|
||||
|
||||
* GITHUB#12839: Introduce method to grow arrays up to a given upper limit and use it to reduce overallocation for
|
||||
DirectoryTaxonomyReader#getBulkOrdinals. (Stefan Vodita)
|
||||
|
||||
|
|
|
@ -159,7 +159,7 @@ public abstract class ByteBufferIndexInput extends IndexInput implements RandomA
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readLongs(long[] dst, int offset, int length) throws IOException {
|
||||
public final void readLongs(long[] dst, int offset, int length) throws IOException {
|
||||
// ByteBuffer#getLong could work but it has some per-long overhead and there
|
||||
// is no ByteBuffer#getLongs to read multiple longs at once. So we use the
|
||||
// below trick in order to be able to leverage LongBuffer#get(long[]) to
|
||||
|
@ -283,6 +283,18 @@ public abstract class ByteBufferIndexInput extends IndexInput implements RandomA
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int readVInt() throws IOException {
|
||||
// this can make JVM less confused (see LUCENE-10366)
|
||||
return super.readVInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final long readVLong() throws IOException {
|
||||
// this can make JVM less confused (see LUCENE-10366)
|
||||
return super.readVLong();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final long readLong() throws IOException {
|
||||
try {
|
||||
|
|
|
@ -254,6 +254,18 @@ abstract class MemorySegmentIndexInput extends IndexInput implements RandomAcces
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int readVInt() throws IOException {
|
||||
// this can make JVM less confused (see LUCENE-10366)
|
||||
return super.readVInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final long readVLong() throws IOException {
|
||||
// this can make JVM less confused (see LUCENE-10366)
|
||||
return super.readVLong();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final long readLong() throws IOException {
|
||||
try {
|
||||
|
|
|
@ -252,6 +252,18 @@ abstract class MemorySegmentIndexInput extends IndexInput implements RandomAcces
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int readVInt() throws IOException {
|
||||
// this can make JVM less confused (see LUCENE-10366)
|
||||
return super.readVInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final long readVLong() throws IOException {
|
||||
// this can make JVM less confused (see LUCENE-10366)
|
||||
return super.readVLong();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final long readLong() throws IOException {
|
||||
try {
|
||||
|
|
|
@ -252,6 +252,18 @@ abstract class MemorySegmentIndexInput extends IndexInput implements RandomAcces
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int readVInt() throws IOException {
|
||||
// this can make JVM less confused (see LUCENE-10366)
|
||||
return super.readVInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final long readVLong() throws IOException {
|
||||
// this can make JVM less confused (see LUCENE-10366)
|
||||
return super.readVLong();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final long readLong() throws IOException {
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue