<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hello,<br>
      Any volunteers to be a second reviewer?<br>
      <br>
      On 18.05.15 12:03, Anton V. Tarasov wrote:<br>
    </div>
    <blockquote cite="mid:5559AACB.4020701@oracle.com" type="cite">
      <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
      <div class="moz-cite-prefix">On 15.05.2015 1:57, Sergey Bylokhov
        wrote:<br>
      </div>
      <blockquote cite="mid:55552866.1070407@oracle.com" type="cite">
        <meta content="text/html; charset=utf-8"
          http-equiv="Content-Type">
        Hi, Anton.<br>
        <blockquote cite="mid:5551E93C.2010807@oracle.com" type="cite">
          <pre style="color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span class="new" style="color: blue; font-weight: normal;">+     * Determines the bounds of a visible part of the component relative to its</span>
<span class="new" style="color: blue; font-weight: normal;">+     * parents.</span>
</pre>
          Did you mean "to its parent"?<br
            class="Apple-interchange-newline">
        </blockquote>
        Yep, new version:<br>
        <a moz-do-not-send="true" class="moz-txt-link-freetext"
          href="http://cr.openjdk.java.net/%7Eserb/8071306/webrev.05/">http://cr.openjdk.java.net/~serb/8071306/webrev.05/</a><br>
      </blockquote>
      <br>
      Looks good to me.<br>
      <br>
      Regards,<br>
      Anton.<br>
      <br>
      <br>
      <blockquote cite="mid:55552866.1070407@oracle.com" type="cite">
        <blockquote cite="mid:5551E93C.2010807@oracle.com" type="cite">
          <br>
          <blockquote cite="mid:554D57A6.40202@oracle.com" type="cite">
            <blockquote cite="mid:554C8093.50205@oracle.com" type="cite">
              <div class="moz-cite-prefix"> <br>
                2.<br>
                <br>
                 100      * The components in this container.<br>
                 101      * @see #add<br>
                 102      * @see #getComponents<br>
                 103      */<br>
                 104     private java.util.List<Component>
                component = new ArrayList<>();<br>
                <br>
                May be it's worth to rename the field? The "component"
                name is odd...<br>
              </div>
            </blockquote>
            I suppose it wasn't changed, because this name is used in
            the serialization for a long time. Plus there are a bunch of
            the similar vars like: tmpComponent etc. I can do it later
            for jdk9 only. </blockquote>
          <br>
          Ok, thanks. It's up to you.<br>
          <br>
          Regards,<br>
          Anton.<br>
          <br>
          <blockquote cite="mid:554D57A6.40202@oracle.com" type="cite">
            <meta http-equiv="content-type" content="text/html;
              charset=utf-8">
            <blockquote cite="mid:554C8093.50205@oracle.com" type="cite">
              <div class="moz-cite-prefix"> <br>
                Regards,<br>
                Anton.<br>
                <br>
                On 07.05.2015 3:39, Sergey Bylokhov wrote:<br>
              </div>
              <blockquote cite="mid:554AB431.1040707@oracle.com"
                type="cite">
                <meta http-equiv="content-type" content="text/html;
                  charset=utf-8">
                <tt>Hello.</tt><br>
                <tt>Please review the fix for a jdk9. I plan to backport
                  it to jdk8u60.</tt><br>
                <br>
                <tt>Description.</tt><br>
                <tt>An </tt><tt>UI</tt><tt> works really slowly, when
                  an application has a lot of components in one
                  container, and these components should be disabled one
                  by one.</tt><br>
                <tt>The reason is the next sequence of methods calls:</tt><br>
                <tt>Component.setEnabled->updateCursorImmediately()->


                  some cursor related
                  staff->GlobalCursorManager._updateCursor->Container.findComponentAt()-iteration






                  over all components in the container.....->
                  twice....<br>
                  <br>
                </tt><tt>You can imagine how it works in case of 10000
                  components in the container.</tt><br>
                <br>
                <tt>Note that in the bug report described difference
                  jdk6 vs jdk8 -> 1sec vs 6 sec. This was caused by
                  the two fixes, one of which adds checkTreeLock() and
                  in another one a simple array of components was
                  replaced by the ArrayList. Since code was added to the
                  really hot method we got so big slowdown.</tt><br>
                <br>
                <tt>To fix the problem I suggest two different
                  approaches:</tt><br>
                <tt> - </tt><tt> </tt>
                <meta name="qrichtext" content="1">
                <tt>Container.java: </tt>
                <meta http-equiv="Content-Type" content="text/html;
                  charset=utf-8">
                <style type="text/css">
p, li { white-space: pre-wrap; }
</style><tt>Fix a general case, by eliminating a second iteration in the
                  hot loop.</tt><br>
                <tt> - </tt><tt> </tt>
                <meta name="qrichtext" content="1">
                <tt>Component.java: </tt>
                <meta http-equiv="Content-Type" content="text/html;
                  charset=utf-8">
                <style type="text/css">
p, li { white-space: pre-wrap; }
</style><tt>Totally eliminates cursor machinery, if component cannot
                  affect current cursor. </tt><br>
                <br>
                <tt>Some speedup measurements on my local system:</tt><br>
                <tt> - Simple removing of checkTreeLock() will partly
                  solve a regression reported by the user(12 sec -> 5
                  sec).</tt><br>
                <tt> - Changes in the loop will speedup the code in the
                  worse case(5->2 sec)</tt><br>
                <tt> - The changes in the Component.java will change the
                  performance from 2 sec to 100< ms</tt><br>
                <br>
                <tt>Test case which was added was improved from 10
                  seconds to 80 ms.</tt><br>
                <br>
                <tt>JMH test: </tt><tt><a moz-do-not-send="true"
                    class="moz-txt-link-freetext"
                    href="http://cr.openjdk.java.net/%7Eserb/8071306/">http://cr.openjdk.java.net/~serb/8071306/</a></tt><tt>SetEnabledPerformanceTest.java</tt><br>
                <br>
                <tt>Fixed</tt><tt> version:</tt><br>
                <br>
                <tt>Benchmark                                      
                  Mode  Cnt       Score       Error   Units</tt><br>
                <tt>SetEnabledPerformanceTest.testContains        
                  thrpt    5  301300,813 ± 17338,045  ops/ms</tt><br>
                <tt>SetEnabledPerformanceTest.testFindComponentAt 
                  thrpt    5      20,521 ±     0,269  ops/ms</tt><br>
                <tt>SetEnabledPerformanceTest.testGetComponentAt  
                  thrpt    5      22,297 ±     1,264  ops/ms</tt><br>
                <tt>SetEnabledPerformanceTest.testSetEnabled      
                  thrpt    5     711,120 ±    19,837  ops/ms</tt><br>
                <br>
                <tt>Base version:</tt><br>
                <br>
                <tt>Benchmark                                      
                  Mode  Cnt       Score      Error   Units</tt><br>
                <tt>SetEnabledPerformanceTest.testContains        
                  thrpt    5  299145,642 ± 2120,183  ops/ms</tt><br>
                <tt>SetEnabledPerformanceTest.testFindComponentAt 
                  thrpt    5       1,101 ±    0,012  ops/ms</tt><br>
                <tt>SetEnabledPerformanceTest.testGetComponentAt  
                  thrpt    5       6,792 ±    0,097  ops/ms</tt><br>
                <tt>SetEnabledPerformanceTest.testSetEnabled      
                  thrpt    5       0,464 ±    0,020  ops/ms</tt><br>
                <br>
                <br>
                <tt>Bug: <a moz-do-not-send="true"
                    class="moz-txt-link-freetext"
                    href="https://bugs.openjdk.java.net/browse/JDK-8071306">https://bugs.openjdk.java.net/browse/JDK-8071306</a></tt><br>
                <tt>Webrev can be found at: <a moz-do-not-send="true"
                    class="moz-txt-link-freetext"
                    href="http://cr.openjdk.java.net/%7Eserb/8071306/webrev.03">http://cr.openjdk.java.net/~serb/8071306/webrev.03</a></tt><br>
                <br>
                --<br>
                Best regards, Sergey. </blockquote>
              <br>
            </blockquote>
            <br>
            <br>
            <pre class="moz-signature" cols="72">-- 
Best regards, Sergey. </pre>
          </blockquote>
          <br>
        </blockquote>
        <br>
        <br>
        <pre class="moz-signature" cols="72">-- 
Best regards, Sergey. </pre>
      </blockquote>
      <br>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Best regards, Sergey. </pre>
  </body>
</html>