On Mon, 16 Mar 2026 20:27:40 GMT, Andy Goryachev <[email protected]> wrote:

>> chuckyschluz has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   minor cleanup
>
> my limited testing shows no difference between pure #2109 and merged with 
> this PR... will continue testing.

@andy-goryachev-oracle 

[JDK8311505Test.java](https://github.com/user-attachments/files/26042227/JDK8311505Test.java)

This tests `TableView` and  `TreeTableView` as these are the only objects that 
should receive any benefit from this PR. The changes I made to 
`MultipleSelectionModelBase` are not used anywhere in JFX except in 
`ControlUtils`, which in turn is only used for `TableView` and  
`TreeTableView`. 

This PR fixes the deselection problem in both `TableView` and `TreeTableView`. 
`TreeTableView` select all is still slow. 
[JDK-8181411](https://bugs.openjdk.org/browse/JDK-8181411)

`TableView`:

Item Count | Master Select | Fixed Select | Select Improv. | Master Deselect | 
Fixed Deselect | Deselect Improv.
-- | -- | -- | -- | -- | -- | --
16,384 | 7ms | 7ms | — | 83ms | 4ms | ~20x
65,536 | 25ms | 18ms | ~1.4x | 1,283ms | 9ms | ~142x
131,072 | 63ms | 31ms | ~2.0x | 5,142ms | 16ms | ~321x
262,144 | 195ms | 82ms | ~2.3x | 20,526ms | 31ms | ~662x
524,288 | 639ms | 126ms | ~5x | 82,310ms | 96ms | ~857x

`TreeTableView`:

Item Count | Master Select | Fixed Select | Select Improv. | Master Deselect | 
Fixed Deselect | Deselect Improv.
-- | -- | -- | -- | -- | -- | --
8,192 | 54ms | 50ms | — | 22ms | 1ms | ~22x
32,768 | 1,451ms | 1,448ms | — | 315ms | 3ms | ~105x
65,536 | 6,505ms | 7,702ms | — | 1,247ms | 8ms | ~155x
131,072 | 37,034ms | 49,681ms | — | 5,045ms | 13ms | ~388x
262,144 | 260,019ms | 278,258ms | — | 20,025ms | 33ms | ~606x

I presume the slight regression in `TreeTableView` select is attributed to 
constructing the added indices `List<Integer>`, but I am confused why it helps 
with `TableView`. I can probably make it a bit faster by passing a raw `int[]` 
array instead of a `List<Integer>`.

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

PR Comment: https://git.openjdk.org/jfx/pull/2100#issuecomment-4072240390

Reply via email to