RFR: 8197991: Selecting many items in a TableView is very slow

yosbits duke at openjdk.java.net
Wed Nov 24 14:43:11 UTC 2021


On Mon, 22 Nov 2021 16:25:22 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:

>> I could move `int max = size();` outside the loop
>
> But why? The initialization block of a `for` statement is exactly where you'd put loop-scoped variables.

This change significantly improves performance because the BitSet's size () method is an O (N) implementation. You may be wondering because it is O (1) in many other collections.

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

PR: https://git.openjdk.java.net/jfx/pull/673


More information about the openjfx-dev mailing list