RFR: 8292937: Improve performance of some read operations of RandomAccessFile

Quan Anh Mai duke at openjdk.org
Fri Aug 26 01:52:54 UTC 2022


On Thu, 25 Aug 2022 19:10:19 GMT, Сергей Цыпанов <duke at openjdk.org> wrote:

>> Maybe you can modify the `read0` method to receive a width parameter additionally. Or we can wait for Panama and use `mmap` for this instead of JNI? Thanks.
>
>> Maybe you can modify the read0 method to receive a width parameter additionally.
> 
> @merykitty sorry, I don't get it. We already have `readBytes0()` returning array. Why do we need to add a new param to `read0`?

@stsypanov `readBytes0` reads an arbitrary number of bytes and writes them to the given buffer. What I mean here is to have `read0` read 1, 2, 4 or 8 bytes then extend the result to a `jlong`, remove the need to write the result in an array.

-------------

PR: https://git.openjdk.org/jdk/pull/10031


More information about the core-libs-dev mailing list