How to change compilation policy to trigger C2 compilation ASAP?
Tangwei (Euler)
tangwei6 at huawei.com
Wed May 20 02:29:41 UTC 2015
Got it! Thanks a lot!
Regards!
wei
From: Vitaly Davidovich [mailto:vitalyd at gmail.com]
Sent: Wednesday, May 20, 2015 10:11 AM
To: Tangwei (Euler)
Cc: hotspot compiler; Vladimir Kozlov
Subject: RE: How to change compilation policy to trigger C2 compilation ASAP?
I'll let Vladimir comment on the compile command, but turning off tiered doesn't prevent inlining. What prevents inlining (an otherwise inlineable method), in a nutshell, is lack of profiling information that would indicate the method or callsite is hot enough for inlining. So you can have tiered off and run C2 with standard compilation thresholds, and you'll likely get good inlining because you'll have a long profile. If you turn C2 compile threshold down too far (and too far is going to be app-specific), C2 compilation may not have sufficient info in the shortened profile to decide to inline. Or even worse, the profile collected is actually not reflective of the real profile you want to capture (e.g. app has a phase change after initialization).
The theoretical advantage of tiered is you can get decent perf quickly, but also since you're getting better than interpreter speed quickly, you can run in C1 tier longer and thus collect an even larger profile, possibly leading to better code than C2 alone. But unfortunately this may require serious tuning. That's my understanding at least.
sent from my phone
On May 19, 2015 10:00 PM, "Tangwei (Euler)" <tangwei6 at huawei.com<mailto:tangwei6 at huawei.com>> wrote:
Vladimir,
What the 'double' means in following command line? The option CompileThresholdScaling you mentioned is same as ProfileMaturityPercentage?
I cannot find the option in code. How much effect to function inlining by turning off tiered compilation?
> -XX:CompileCommand=option,SomeClass.someMethod,double,CompileThresholdScaling,0.5
Regards!
wei
> -----Original Message-----
> From: Vladimir Kozlov [mailto:vladimir.kozlov at oracle.com<mailto:vladimir.kozlov at oracle.com>]
> Sent: Wednesday, May 20, 2015 9:12 AM
> To: Tangwei (Euler); Vitaly Davidovich
> Cc: hotspot compiler
> Subject: Re: How to change compilation policy to trigger C2 compilation ASAP?
>
> If you want only C2 compilation you can disable tiered compilation (since you
> don't want to spend to much on profiling anyway) and set low
> CompileThreshold (you need only this one for non-tiered compile):
>
> -XX:-TieredCompilation -XX:CompileThreshold=100
>
> If your method is simple and don't need profiling or inlining the generated code
> could be same quality as with long profiling.
>
> An other approach is to set threshold per method (scale all threasholds (C1, C2,
> interpreter) by this value). For example to reduce thresholds by half:
>
> -XX:CompileCommand=option,SomeClass.someMethod,double,CompileThresh
> oldScaling,0.5
>
> Vladimir
>
> On 5/19/15 5:43 PM, Tangwei (Euler) wrote:
> > My goal is just to reach peak performance quickly. Following is one
> > tier threshold combination I tried:
> >
> > -XX:Tier0ProfilingStartPercentage=0
> >
> > -XX:Tier3InvocationThreshold=3
> >
> > -XX:Tier3MinInvocationThreshold=2
> >
> > -XX:Tier3CompileThreshold=2
> >
> > -XX:Tier4InvocationThreshold=4
> >
> > -XX:Tier4MinInvocationThreshold=3
> >
> > -XX:Tier4CompileThreshold=2
> >
> > Regards!
> >
> > wei
> >
> > *From:*Vitaly Davidovich [mailto:vitalyd at gmail.com<mailto:vitalyd at gmail.com>]
> > *Sent:* Tuesday, May 19, 2015 9:33 PM
> > *To:* Tangwei (Euler)
> > *Cc:* hotspot compiler
> > *Subject:* Re: How to change compilation policy to trigger C2
> > compilation ASAP?
> >
> > Is your goal specifically to have C2 compile or just to reach peak
> > performance quickly? It sounds like the latter. What values did you
> > specify for the tier thresholds? Also, it may help you to
> > -XX:+PrintCompilation to tune the flags as this will show you which
> > methods are being compiled, when, and at what tier.
> >
> > sent from my phone
> >
> > On May 19, 2015 9:01 AM, "Tangwei (Euler)" <tangwei6 at huawei.com<mailto:tangwei6 at huawei.com>
> > <mailto:tangwei6 at huawei.com<mailto:tangwei6 at huawei.com>>> wrote:
> >
> > Hi All,
> >
> > I want to run a JAVA application on a performance simulator, and do
> > a profiling on a hot function JITTed with C2 compiler.
> >
> > In order to make C2 compiler compile hot function as early as
> > possible, I hope to reduce the threshold of function invocation
> >
> > count in interpreter and C1 to drive the JIT compiler transitioned to
> > Level 4 (C2) ASAP. Following is the option list I try, but
> >
> > failed to find a right combination to meet my requirement. Anyone can
> > help to figure out what options I can use?
> >
> > Thanks in advance.
> >
> > -XX:Tier0ProfilingStartPercentage=0
> >
> > -XX:Tier3InvocationThreshold
> >
> > -XX:Tier3MinInvocationThreshold
> >
> > -XX:Tier3CompileThreshold
> >
> > -XX:Tier4InvocationThreshold
> >
> > -XX:CompileThreshold
> >
> > -XX:Tier4MinInvocationThreshold
> >
> > -XX:Tier4CompileThreshold
> >
> > Regards!
> >
> > wei
> >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20150520/8305d9ed/attachment-0001.html>
More information about the hotspot-compiler-dev
mailing list