RFR: 8185886: Improve scrolling performance of TableView and TreeTableView
github.com+6702882+dannygonzalez at openjdk.java.net
Mon Feb 24 08:16:22 UTC 2020
On Sun, 23 Feb 2020 04:20:55 GMT, Nir Lisker <nlisker at openjdk.org> wrote:
>> Optimisation to ExpressionHelper.Generic class to use Sets rather than Arrays to improve listener removal speed.
>> This was due to the removal of listeners in TableView taking up to 50% of CPU time on the JavaFX Application thread when scrolling/adding rows to TableViews.
>> This may alleviate some of the issues seen here:
>> TableView has a horrific performance with many columns #409
>> JDK-8088394 : Huge memory consumption in TableView with too many columns
>> JDK-8166956: JavaFX TreeTableView slow scroll performance
>> JDK-8185887: TableRowSkinBase fails to correctly virtualise cells in horizontal direction
>> OpenJFX mailing list thread: TableView slow vertical scrolling with 300+ columns
> modules/javafx.base/src/main/java/com/sun/javafx/binding/ExpressionHelper.java line 197:
>> 196: private int weakChangeListenerGcCount = 2;
>> 197: private int weakInvalidationListenerGcCount = 2;
> Why are these set to 2 and why do you need them at all? The previous implementation needed to grow and shrink the array so it had to keep these, but `Map` takes care of this for you.
I agree, I kept these in as I wasn't sure if there was a need to manually force the garbage collection of weak listeners at the same rate as the original implementation.
Removing this would make sense to me also.
More information about the openjfx-dev