RFR: 8331876: JFR: Move file read and write events to java.base [v3]

Alan Bateman alanb at openjdk.org
Sun May 12 07:30:07 UTC 2024


On Sat, 11 May 2024 19:31:34 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:

> If an event class is loaded before JFR is started, the event class needs to be retransformed, but if it is loaded later, we can add instrumentation on class load and avoid the retransformation. More happens when an event class is loaded compared to ordinary class load, for example, a startTime field is added.
> 
> I did a JMH run and the difference between Event::enabled() and a boolean flag was a fraction of nanosecond.

There are instances of FIS/FOS created in initPhase1 for the standard streams so loading as few classes and executing as minimal as possible is good. RAF will typically be used early too as the zip code opens zip files with a RAF. So doing as little as possible is good.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19129#discussion_r1597570831


More information about the core-libs-dev mailing list