[
https://issues.apache.org/jira/browse/LUCENE-10149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17424465#comment-17424465
]
Robert Muir commented on LUCENE-10149:
--------------------------------------
{quote}
Dawid's hint in the other issue is IMHO not needed, I would not add any
assertion: The ByteBuffers in the ByteBufferIndexInput are already correctly
configured to be little endian, no need to check this over and over.
{quote}
I agree, it already ensures read-only/LE view in the constructor:
{code}
public ByteBuffersDataInput(List<ByteBuffer> buffers) {
ensureAssumptions(buffers);
this.blocks =
buffers.stream()
.map(buf -> buf.asReadOnlyBuffer().order(ByteOrder.LITTLE_ENDIAN))
.toArray(ByteBuffer[]::new);
{code}
> ByteBuffersDataInput should override readShort/Int/Long
> -------------------------------------------------------
>
> Key: LUCENE-10149
> URL: https://issues.apache.org/jira/browse/LUCENE-10149
> Project: Lucene - Core
> Issue Type: Task
> Reporter: Robert Muir
> Priority: Major
> Attachments: LUCENE-10149.patch
>
>
> ByteBuffersDataInput currently only optimizes the absolute {{readShort(long
> pos)}}, {{readInt(long pos)}}, {{readLong(long pos)}}.
> This is good because these are e.g. used by docvalues.
> On the other hand it should also optimize the relative {{readShort()}},
> {{readInt()}}, and {{readLong()}} in the same way. In some cases these are
> performance sensitive too. For example, the postings list compression uses
> {{readLong()}}.
> Looking at the code, this seems to be a simple oversight.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]