HotSpot compilation latency

Stefan Reich stefan.reich.maker.of.eye at googlemail.com
Mon Aug 12 12:07:43 UTC 2019


Hi Tobias, thank you for your quick answer.

So the compilation thresholds themselves are all independent of wall time.
That's pretty cool. Thus on a machine twice as fast compilation should kick
in twice as fast too.

> That depends on how often the loop backedge is taken on your system in
that second.

Is this dependent on a fixed-interval timer or something? Is it specified?

Thanks,
Stefan

On Mon, 12 Aug 2019 at 14:02, Tobias Hartmann <tobias.hartmann at oracle.com>
wrote:

> Hi Stefan,
>
> On 12.08.19 13:50, Stefan Reich wrote:
> > How quickly does HotSpot start (and finish) to compile methods? Is this
> > dependent on the system's speed or on wall time?
>
> A method is JIT compiled once the number of invocations or backedges (for
> loops) reaches the
> corresponding invocation threshold.
>
> With TieredCompilation there are different thresholds for the different
> tiers:
>
> http://hg.openjdk.java.net/jdk/jdk/file/0211b062843d/src/hotspot/share/runtime/globals.hpp#l1975
>
> See also slide 17 and 36 of:
> http://cr.openjdk.java.net/~thartmann/talks/2017-Hotspot_Under_The_Hood.pdf
>
> > So, if I execute, say, a loop that runs for one second, is there a chance
> > it will be compiled and on-stack-replaced with an optimized version
> within
> > that second?
>
> That depends on how often the loop backedge is taken on your system in
> that second.
>
> Best regards,
> Tobias
>


-- 
Stefan Reich
BotCompany.de // Java-based operating systems


More information about the hotspot-dev mailing list