RFR: 8185887: Fix VirtualFlow performance regression in ListView scrolling

Huang Xiao duke at openjdk.org
Sun Jan 11 17:07:12 UTC 2026


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.

-------------

Commit messages:
 - 8185887: Fix VirtualFlow performance regression in ListView scrolling

Changes: https://git.openjdk.org/jfx/pull/2030/files
  Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=2030&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8185887
  Stats: 12 lines in 1 file changed: 0 ins; 12 del; 0 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


More information about the openjfx-dev mailing list