Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8315768 | jfx17.0.9 | Jose Pereda | P4 | Resolved | Fixed | b03 |
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.
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
- backported by
-
JDK-8315768 Potential performance improvements in VirtualFlow
- Resolved