[10] RFR: 8179040: Avoid Ticks::now calls when EventClassLoad is not enabled

David Holmes david.holmes at oracle.com
Tue Apr 25 20:58:52 UTC 2017

Hi Claes,

On 25/04/2017 11:21 PM, Claes Redestad wrote:
> Hi,
> this patch removes calling Ticks::now when EventClassLoad isn't enabled,
> which has an effect on class loading performance:
> http://cr.openjdk.java.net/~redestad/8179040/hotspot.01/
> When tracing isn't enabled trace/tracing.hpp has dummy
> implementations which are easily optimized away by a compiler, which
> I've verified happens on linux OpenJDK builds with tracing disabled.

What you have done achieves your goal and could be pushed as-is.

That said, I would consider revisiting the conditional versus 
unconditional use of trace-related code in general. So that things like:

  649   EventClassLoad class_load_start_event;
  895   post_class_load_event(&class_load_start_event, k, loader_data);

were done using TRACE_ONLY, so that all trace-related code was 
completely excluded when not using INCLUDE_TRACE.


> On builds with tracing enabled then the changes means the call to
> get the time only happen if the event is enabled, which achieves the
> sought after startup optimization. >
> Thanks!
> /Claes

More information about the hotspot-runtime-dev mailing list