Re: RFR: 8298639: Perform I/O operations in bulk for RandomAccessFile [v2]
On Tue, 13 Dec 2022 19:57:29 GMT, Alan Bateman wrote: > I think that PR was closed as it went inactive Yep, I think there I did everything I could, hope this one will be merged as the changes are helpful - PR: https://git.openjdk.org/jdk/pull/11644
Re: RFR: 8298639: Perform I/O operations in bulk for RandomAccessFile [v2]
On Tue, 13 Dec 2022 09:27:24 GMT, Per Minborg wrote: >> This PR suggests improving performance for read and write operations for the >> longer primitives in `RandomAccessFile`. >> >> These improvements would also propagate to other JDK classes relying on >> these improved `RandomAccessFile` operations. > > Per Minborg has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains two commits: > > - Merge master > - Perform I/O operations in bulk for RandomAccessFile > As far as I understand #10031 was closed because there we doubts about > whether it's safe to use shared array within multiple methods. Here we use > the same approach. I think that PR was closed as it went inactive but I think where you got to is very similar to what Per's change is now. RandomAccessFile doesn't specify it but it can't be used from several threads without external synchronization. This is because it maintains a file position that is updated when reading and writing, or it can be changed when seeking to positions in the file. So on the surface, the byte[] should be okay. - PR: https://git.openjdk.org/jdk/pull/11644
Re: RFR: 8298639: Perform I/O operations in bulk for RandomAccessFile [v2]
On Tue, 13 Dec 2022 09:27:24 GMT, Per Minborg wrote: >> This PR suggests improving performance for read and write operations for the >> longer primitives in `RandomAccessFile`. >> >> These improvements would also propagate to other JDK classes relying on >> these improved `RandomAccessFile` operations. > > Per Minborg has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains two commits: > > - Merge master > - Perform I/O operations in bulk for RandomAccessFile src/java.base/share/classes/java/io/RandomAccessFile.java line 930: > 928: public final long readLong() throws IOException { > 929: readFully(buffer, 0, Long.BYTES); > 930: return (((long)(buffer[0] ) << 56) + I think you can use `Bits.getLong()` here - PR: https://git.openjdk.org/jdk/pull/11644
Re: RFR: 8298639: Perform I/O operations in bulk for RandomAccessFile [v2]
On Tue, 13 Dec 2022 09:27:24 GMT, Per Minborg wrote: >> This PR suggests improving performance for read and write operations for the >> longer primitives in `RandomAccessFile`. >> >> These improvements would also propagate to other JDK classes relying on >> these improved `RandomAccessFile` operations. > > Per Minborg has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains two commits: > > - Merge master > - Perform I/O operations in bulk for RandomAccessFile As far as I understood https://github.com/openjdk/jdk/pull/10031 was closed because there we doubts about whether it's safe to use shared array - PR: https://git.openjdk.org/jdk/pull/11644
Re: RFR: 8298639: Perform I/O operations in bulk for RandomAccessFile [v2]
> This PR suggests improving performance for read and write operations for the > longer primitives in `RandomAccessFile`. > > These improvements would also propagate to other JDK classes relying on these > improved `RandomAccessFile` operations. Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits: - Merge master - Perform I/O operations in bulk for RandomAccessFile - Changes: https://git.openjdk.org/jdk/pull/11644/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=11644&range=01 Stats: 61 lines in 2 files changed: 19 ins; 16 del; 26 mod Patch: https://git.openjdk.org/jdk/pull/11644.diff Fetch: git fetch https://git.openjdk.org/jdk pull/11644/head:pull/11644 PR: https://git.openjdk.org/jdk/pull/11644