easyice commented on PR #12841: URL: https://github.com/apache/lucene/pull/12841#issuecomment-1844310878
@uschindler Thanks for review! > With unaligned random reads you mean that you read with positional reads from the area where the buffer is saved? With default DataInput you can only go forward, so you need to read everything and also in order. The optimized decode for an integer value using `getInt(pos) & mask`, it interprets the following bytes as intger, then use `mask` to remove unnecessary, since the length of each value is not fixed, the `getInt(pos)` will like `getInt(1); getInt(2); getInt(4); getInt(7)`, so it is unaligned random reads. This random access is not supported in `DataInput`, and possibility a bit heavy if use `RandomAccessInput` directly. > The best idea that I have instead of VarHandles: Create an implementation for ByteBuffer do you mean create an implementation to get the current block as `ByteBuffer` for `BufferedIndexInput` `ByteBuffersDataInput` and `MemorySegmentIndexInput` like "wrapSliceAsByteBuffer()" ? then put the decode function `readGroupVInt` to `DataInput`? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org