Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8127688

Controls.ListView-Rotate performance dropped up to 0 fps in fx2.1-b08

    XMLWordPrintable

Details

    Description

      Controls.ListView-Rotate performance benchmark reports 0 fps in latest promoted fx2.1-b08 build.
      This benchmark is simply not able to handle even one pulse and finally it is not able to complete.

      The benchmark is run with following arguments:
       jrockit.bm.Main controls.bm.ListViewBenchmark -i 20 -wt 5 -tr 15 -cells 10000 -mode rotate -keysPerInjection 100


      Running the same benchmark with less number of cells shows the following performance difference comparing to b07:
      > java -cp "..." -Djavafx.animation.fullspeed=true
        jrockit.bm.Main controls.bm.ListViewBenchmark -i 20 -wt 0 -tr 30 -cells 1000 -mode rotate -keysPerInjection 10

      b07: 195 fps
      b08: 0.96 fps

      JPA profile shows the following difference:
      === b07 ===
       7.041 controls.ListViewTest.run()
             6.308 com.sun.javafx.collections.ObservableListWrapper.remove(int)
             0.723 com.sun.javafx.collections.ObservableListWrapper.add(java.lang.Object)

      === b08 ===
      32.034 controls.ListViewTest.run()
             16.088 com.sun.javafx.collections.ObservableListWrapper.remove(int)
             15.942 com.sun.javafx.collections.ObservableListWrapper.add(java.lang.Object)


      If we look at com.sun.javafx.collections.ObservableListWrapper.add we will see that the time spent in
      com.sun.javafx.scene.control.behavior.ListViewBehavior$1.onChanged() has been increased from
      0.017 sec to 31.919 sec.

      Here are related ListViewBehavior.java went into b08:

      diff -r 38665fd4d922 -r 2351e0099f49 javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/ListViewBehavior.java
      --- a/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/ListViewBehavior.java Wed Jan 04 16:01:21 2012 +1000
      +++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/behavior/ListViewBehavior.java Tue Jan 10 21:16:06 2012 +1300

      @@ -247,8 +247,22 @@

               @Override public void onChanged(ListChangeListener.Change c) {
                   while (c.next()) {
                       // there are no selected items, so lets clear out the anchor
      - if (! selectionChanging && c.getList().isEmpty()) {
      - setAnchor(-1);
      + if (! selectionChanging) {
      + if (c.getList().isEmpty()) {
      + setAnchor(-1);
      + } else if (! c.getList().contains(getAnchor())) {
      + setAnchor(-1);
      + }
      + }
      +
      + if (! hasAnchor() && c.getAddedSize() > 0) {
      + for (int i = 0; i < c.getAddedSize(); i++) {
      + int index = ((List<Integer>)c.getAddedSubList()).get(i);
      + if (index >= 0) {
      + setAnchor(index);
      + break;
      + }
      + }
                       }
                   }
               }

      See more changes in fx2.1 workspace.

      Attachments

        Activity

          People

            jgiles Jonathan Giles
            epavlova Ekaterina Pavlova
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: