Performance degradation due to probable (?) C2 issue
Remi Forax
forax at univ-mlv.fr
Fri Jul 31 12:38:11 UTC 2020
----- Mail original -----
> De: "Сергей Цыпанов" <sergei.tsypanov at yandex.ru>
> À: "Andrew Haley" <aph at redhat.com>, "hotspot compiler" <hotspot-compiler-dev at openjdk.java.net>
> Envoyé: Vendredi 31 Juillet 2020 11:11:39
> Objet: Re: Performance degradation due to probable (?) C2 issue
> Hi,
>
> could I ask one more question?
>
> You wrote previosuly:
>
>> Here, it's detected that CharArrayWriter::toString is large
>> and has already been compiled so there's no sense inlining another copy of it.
>
> So as far as CharArrayWriter::toString is compiled, but not inlined into call
> site
> we have to do a real method call and it this call causes degradation, right?
yes,
if you never share code you ends up with several giga bytes of assembly codes which destroy your perf because you start to have a lot of cache miss on the instructions.
so there is a trade off between a theoritical fully inlined program and a never inlined program.
>
> Regards,
> Sergey Tsypanov
regards,
Rémi
>
>
>
> 28.07.2020, 14:12, "Andrew Haley" <aph at redhat.com>:
>> Hi,
>>
>> On 28/07/2020 11:35, Сергей Цыпанов wrote:
>>
>>> So my question is whether there's something wrong with compier of
>>> the original idea of improvement was wrong?
>>
>> No, and (probably) no.
>>
>> C2 uses a bunch of of heuristics. Here, it's detected that
>> CharArrayWriter::toString is large and has already been compiled so
>> there's no sense inlining another copy of it. This isn't necessarily
>> true, but it's a good guess. Try playing with InlineSmallCode: start
>> with =1000, and increases it from there to see if it helps.
>>
>> --
>> Andrew Haley (he/him)
>> Java Platform Lead Engineer
>> Red Hat UK Ltd. <https://www.redhat.com>
>> https://keybase.io/andrewhaley
> > EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
More information about the hotspot-compiler-dev
mailing list