On Wed, 4 Nov 2026 08:39:34 GMT, Volkan Yazici <[email protected]> wrote:
>> Erik Gahlin has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Use -1 to detect EOF
>
> src/java.base/share/classes/java/io/RandomAccessFile.java line 1043:
>
>> 1041: boolean endOfFile = false;
>> 1042: try {
>> 1043: while (!eol) {
>
> The new code incurs JFR-related bookkeeping (i.e., `endOfFile` and
> `bytesRead` updates) and `try`/`finally` costs even when `!jfrTracing`. Has
> it been verified (via JMH?) that these extra costs when JFR is inactive are
> indeed negligible? Presumably `RAF::readLine` can get very hot in a typical
> application.
The event is enabled by default and probably rare to disable. Measuring would
be good but typically it's the file I/O that dominates. RAF is for random
read/write access, code doing sequential access and reading lines is more
likely to be using something else.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/33637#discussion_r4466181818