> The commit 1b12c8a490 introduced two performance issues in VirtualFlow:
>
> 1. Calling requestLayout() on all cells in the pile on every layout pass This
> causes unnecessary layout calculations for 50-100 recycled cells per frame
> during scrolling.
>
> 2. Using sheetChildren.removeAll(pile) which has O(n*m) time complexity This
> becomes extremely slow with large cell pools.
>
> These changes caused severe scrolling lag in ListView/TableView with many
> items (e.g., 100+ items, even less). The fix removes both problematic code
> blocks while preserving the getViewportBreadth() visibility change needed by
> TableRowSkinBase.
>
> Tested with ListView containing 1000 items - scrolling is now smooth again,
> matching JavaFX 24 performance.
>
> The sample project has been uploaded:
> [demo-javafx.zip](https://github.com/user-attachments/files/24561207/demo-javafx.zip)
>
> My system environment is:
> - Apple M1
> - macOS 26.2
>
> Installed and used JDKs from the following vendors via SDKMAN:
> - 25.0.1-graalce
> - 25.0.1.fx-nik
> - 25.0.1-tem
>
> Without exception, the lists are all somewhat laggy when scrolling. But if I
> downgrade the FX version to 24, only "25.0.1.fx-nik" still shows lag — the
> other two are very smooth!
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
> <modelVersion>4.0.0</modelVersion>
>
> <groupId>com.example</groupId>
> <artifactId>demo-javafx</artifactId>
> <version>1.0-SNAPSHOT</version>
> <packaging>jar</packaging>
>
> <name>JavaFX ListView Demo</name>
>
> <properties>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> <java.version>25</java.version>
> <javafx.version>25</javafx.version>
> <javafx.maven.plugin.version>0.0.8</javafx.maven.plugin.version>
> </properties>
>
> <dependencies>
>
> <dependency>
> <groupId>org.openjfx</groupId>
> <artifactId>javafx-controls</artifactId>
> <version>${javafx.version}</version>
> </dependency>
>
>
> <dependency>
> <groupId>org.openjfx</groupId>
> <artifactId>javafx-fxml</artifactId>
> <version>${javafx.version}</version>
> </dependency>
> </dependencies>
>
> <build>
> <plugins>
>
> <plugin>
> <groupId>org.apache.maven.plugins</g...
youngledo has updated the pull request with a new target base due to a merge or
a rebase. The incremental webrev excludes the unrelated changes brought in by
the merge/rebase. The pull request contains three additional commits since the
last revision:
- Merge remote-tracking branch 'upstream/master' into
fix-virtualflow-performance-regression
- 8185887: Make it visible
- 8185887: Fix VirtualFlow performance regression in ListView scrolling
The commit 1b12c8a490 introduced two performance issues in VirtualFlow:
1. Calling requestLayout() on all cells in the pile on every layout pass
This causes unnecessary layout calculations for 50-100 recycled cells
per frame during scrolling.
2. Using sheetChildren.removeAll(pile) which has O(n*m) time complexity
This becomes extremely slow with large cell pools.
These changes caused severe scrolling lag in ListView/TableView with
many items (e.g., 1000+ items). The fix removes both problematic code
blocks while preserving the getViewportBreadth() visibility change
needed by TableRowSkinBase.
Tested with ListView containing 1000 items - scrolling is now smooth
again, matching JavaFX 24 performance.
-------------
Changes:
- all: https://git.openjdk.org/jfx/pull/2030/files
- new: https://git.openjdk.org/jfx/pull/2030/files/f8a60547..1733bfbc
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jfx&pr=2030&range=02
- incr: https://webrevs.openjdk.org/?repo=jfx&pr=2030&range=01-02
Stats: 509643 lines in 9068 files changed: 256664 ins; 189658 del; 63321 mod
Patch: https://git.openjdk.org/jfx/pull/2030.diff
Fetch: git fetch https://git.openjdk.org/jfx.git pull/2030/head:pull/2030
PR: https://git.openjdk.org/jfx/pull/2030