Performance degradation due to probable (?) C2 issue

Сергей Цыпанов sergei.tsypanov at yandex.ru
Wed Jul 29 07:43:10 UTC 2020


Hi Andrew,

your suggestion was correct: with -XX:InlineSmallCode=1000
patched code works faster than original as expected.

Thanks for explaining that to me!

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