[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    Re: [OpenJDK 2D-Dev] Java2d code using @ForceInline or @Stable annotations
From:       Philip Race <philip.race () oracle ! com>
Date:       2016-03-17 0:29:19
Message-ID: 56E9FA5F.4040902 () oracle ! com
[Download RAW message or body]

A demonstrable 5-10% on a "real program" - one that does something that
is at least representative of a real world benefit is something
you could (should) take to the hotspot team (probably hotspot-compiler-dev)
and point them directly at the program and the results and see what they 
say.
Who knows .. they could say 325 is the result of lots of careful analysis
or they may make some changes as a result, perhaps not to that metric
but to something else.

-phil.



On 3/16/16, 3:25 PM, Laurent Bourgès wrote:
>
> Phil,
>
> I tested adding @ForceInline to few important methods in marlin that 
> jitwatch detected as too large (>325 byte codes).
>
> It seems hotspot perform inlining with the hint and few long tests are 
> a bit faster (max 10%).
>
> I agree it is border line and java2d must respect vm and module rules.
>
> Cheers,
> Laurent
>
> Le 16 mars 2016 17:51, "Philip Race" <philip.race@oracle.com 
> <mailto:philip.race@oracle.com>> a écrit :
> >
> > The jigsaw team would need to sign off on any changes
> > to the module graph and in addition I think the VM team
> > might have some input on this since I don't think this
> > is intended to be used other than extremely sparingly.
> > I see @Stable used only by String and java.lang.invoke
> > which has deep ties to the VM.
> > In other words I am not sure we should do this or if, for ForceIine,
> > it would bring any benefits over what hotspot is doing without 
> prompting.
> >
> > -phil.
> >
> >
> > On 3/16/16, 8:24 AM, Laurent Bourgès wrote:
> >>
> >> Hi,
> >>
> >> In the marlin renderer, I am wondering if I could use the compiler 
> annotations @ForceInline / @Stable (in java.base module).
> >>
> >> It would provide hints to the hotspot compiler and maybe bring some 
> performance benefits.
> >>
> >> Of course, it means adding a qualified export in the modules.xml:
> >> <export>
> >> <name>jdk.internal.vm.annotation</name>
> >> <to>java.desktop</to>
> >> </export>
> >>
> >> Please give me your opinion & comments.
> >>
> >> Laurent
>

[Attachment #3 (text/html)]

<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    A demonstrable 5-10% on a "real program" - one that does something
    that<br>
    is at least representative of a real world benefit is something<br>
    you could (should) take to the hotspot team (probably
    hotspot-compiler-dev)<br>
    and point them directly at the program and the results and see what
    they say.<br>
    Who knows .. they could say 325 is the result of lots of careful
    analysis<br>
    or they may make some changes as a result, perhaps not to that
    metric<br>
    but to something else.<br>
    <br>
    -phil.<br>
    <br>
    <br>
    <br>
    On 3/16/16, 3:25 PM, Laurent Bourgès wrote:
    <blockquote
cite="mid:CAKjRUT7RE4QfjnQ7EmLN9sqRU9u3-TgKEU2mQO2JUWeiTvZ_Ww@mail.gmail.com"
      type="cite">
      <p dir="ltr">Phil,</p>
      <p dir="ltr">I tested adding @ForceInline to few important methods
        in marlin that jitwatch detected as too large (&gt;325 byte
        codes).</p>
      <p dir="ltr">It seems hotspot perform inlining with the hint and
        few long tests are a bit faster (max 10%).</p>
      <p dir="ltr">I agree it is border line and java2d must respect vm
        and module rules.</p>
      <p dir="ltr">Cheers,<br>
        Laurent</p>
      <p dir="ltr">Le  16 mars 2016 17:51, "Philip Race" &lt;<a
          moz-do-not-send="true" href="mailto:philip.race@oracle.com">philip.race@oracle.com</a>&gt;
        a écrit  :<br>
        &gt;<br>
        &gt; The jigsaw team would need to sign off on any changes<br>
        &gt; to the module graph and in addition I think the VM team<br>
        &gt; might have some input on this since I don't think this<br>
        &gt; is intended to be used other than extremely sparingly.<br>
        &gt; I see @Stable used only by String and java.lang.invoke<br>
        &gt; which has deep ties to the VM.<br>
        &gt; In other words I am not sure we should do this or if, for
        ForceIine,<br>
        &gt; it would bring any benefits over what hotspot is doing
        without prompting.<br>
        &gt;<br>
        &gt; -phil.<br>
        &gt;<br>
        &gt;<br>
        &gt; On 3/16/16, 8:24 AM, Laurent Bourgès wrote:<br>
        &gt;&gt;<br>
        &gt;&gt; Hi,<br>
        &gt;&gt;<br>
        &gt;&gt; In the marlin renderer, I am wondering if I could use
        the compiler annotations @ForceInline / @Stable (in java.base
        module).<br>
        &gt;&gt;<br>
        &gt;&gt; It would provide hints to the hotspot compiler and
        maybe bring some performance benefits.<br>
        &gt;&gt;<br>
        &gt;&gt; Of course, it means adding a qualified export in the
        modules.xml:<br>
        &gt;&gt;        &lt;export&gt;<br>
        &gt;&gt;           
        &lt;name&gt;jdk.internal.vm.annotation&lt;/name&gt;<br>
        &gt;&gt;            &lt;to&gt;java.desktop&lt;/to&gt;<br>
        &gt;&gt;        &lt;/export&gt;<br>
        &gt;&gt;<br>
        &gt;&gt; Please give me your opinion &amp; comments.<br>
        &gt;&gt;<br>
        &gt;&gt; Laurent</p>
    </blockquote>
  </body>
</html>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic