On Sat, 11 May 2024 19:31:34 GMT, Erik Gahlin <egah...@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

Reply via email to