How to change compilation policy to trigger C2 compilation ASAP?

Vitaly Davidovich vitalyd at gmail.com
Wed May 20 01:33:51 UTC 2015


Unfortunately, most non-trivial java code needs profiling and inlining to
get decent performance :).

sent from my phone
On May 19, 2015 9:30 PM, "Vladimir Kozlov" <vladimir.kozlov at oracle.com>
wrote:

> I had said "if don't need profiling or inlining" :)
>
> Of cause low threashold affects quality of generated code. Especially if
> it has branches and calls. And you should not expect that you will get the
> same inlining. So profiling result of such code should be considered only
> as approximation.
>
> Vladimir
>
> On 5/19/15 6:15 PM, Vitaly Davidovich wrote:
>
>> Vladimir,
>>
>> Is 100 actually generally good/decent based on our conversation from the
>> other day regarding lack of scaling down certain inlining thresholds?
>>
>> Thanks
>>
>> sent from my phone
>>
>> On May 19, 2015 9:12 PM, "Vladimir Kozlov" <vladimir.kozlov at oracle.com
>> <mailto:vladimir.kozlov at oracle.com>> wrote:
>>
>>     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,CompileThresholdScaling,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/20150519/0d2f87f2/attachment.html>


More information about the hotspot-compiler-dev mailing list