RFR: 8331876: JFR: Move file read and write events to java.base [v3]
Erik Gahlin
egahlin at openjdk.org
Thu May 9 15:43:53 UTC 2024
On Thu, 9 May 2024 14:29:13 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
>> Erik Gahlin has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Move methods
>
> src/java.base/share/classes/jdk/internal/event/JFRTracing.java line 51:
>
>> 49: field.setAccessible(true);
>> 50: field.setBoolean(null, true);
>> 51: }
>
> Using reflection with `Field` seems expedient - a more modern way could be to use `VarHandle` but I guess it would require more setup to obtain a `Lookup` with the proper capabilities?
The field is only used once and a VarHandle implementation loads three additional classes during startup and in my measurements add about 0.6 ms to startup.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19129#discussion_r1595627039
More information about the core-libs-dev
mailing list