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

Potential performance improvements in VirtualFlow

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • jfx21
    • None
    • javafx
    • None
    • b22
    • generic
    • generic

    Backports

      Description

        In https://github.com/openjdk/jfx/pull/1098 we identified a potential performance improvement in VirtualFlow.

        https://github.com/openjdk/jfx/blob/10f41b7d1f2f53ebe2bfdb61de495bbb7290d32d/modules/javafx.controls/src/main/java/javafx/scene/control/skin/VirtualFlow.java#L3106

        double newSize = isVertical() ? cell.getLayoutBounds().getHeight() : cell.getLayoutBounds().getWidth();

        When a fixed cell size is set we do not need (and maybe even want) to ask the cell about his layout bounds but use the fixed cell size instead.
        Retrieving the layout bounds might compute them as a result, so this will also help the performance.

        ---

        Another potential performance improvement is here:
        https://github.com/openjdk/jfx/blob/10f41b7d1f2f53ebe2bfdb61de495bbb7290d32d/modules/javafx.controls/src/main/java/javafx/scene/control/skin/VirtualFlow.java#L2703

        if (isVertical) {
            cell.resize(size, cell.prefHeight(size));
        } else {
            cell.resize(cell.prefWidth(size), size);
        }

        cell.prefHeight() or cell.prefWidth() may be called but the fixed cell size should be used instead.
        Note that this is already done resizeCell(), which does the same thing.

        Attachments

          Issue Links

            Activity

              People

                mhanl Marius Hanl
                mhanl Marius Hanl
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: