RFR: 8185886: Improve scrolling performance of TableView and TreeTableView
github.com+6702882+dannygonzalez at openjdk.java.net
Mon Feb 24 11:06:41 UTC 2020
On Mon, 24 Feb 2020 10:16:55 GMT, dannygonzalez <github.com+6702882+dannygonzalez at openjdk.org> wrote:
>>> So we need to keep the original behaviour from before where a count was checked on every addListener call and the weak references were purged from the array using the original calculation for this count.
>> The GC'd weak listeners do need to be purged, but why is the original behavior of the counters still applicable?
> Just wanted to keep a similar behaviour as before using the same calculation based originally on the size of the listeners array list and now based on the size of the map. So in theory the weak listeners should be trimmed at the same rate as before.
> Happy to hear alternatives.
Also bear in mind that the trimming of weak listeners is extremely slow as it has to iterate through each listener performing the weak listener test. We can't call this every time we add a listener as this would lock up the JavaFX thread completely (I tried it).
I assume this is why the original calculation was used where it backs of the rate the weak listener trimming code was called as the array list grew.
More information about the openjfx-dev