RFR: 8322964: Optimize performance of CSS selector matching [v9]

John Hendrikx jhendrikx at openjdk.org
Fri May 24 08:26:11 UTC 2024


On Thu, 23 May 2024 22:54:15 GMT, Marius Hanl <mhanl at openjdk.org> wrote:

> Code looks good to me. As mentioned above, I tested it already and everything was good, so I'm certain that there is no regression here.
> 
> I'm generally not a big fan of 'reimplementing' Collections, but I can see why it is needed here and it also makes sense, especially for something like CSS which needs to be fast. Something I saw as well in Swing (just check the `ArrayTable` class 😄 ).

I'm not a fan either, especially because custom collection implementations when referred to by their interface may sneak their way through the various classes and eventually be returned to users.  Any deviation from the collection contracts then suddenly is a bug users may encounter.  I would have done this with plain `HashSet` (or `Set.of`) were it not for the fact that a lot of performance gains were possible due to the limited way FX is using these sets.

> I wonder if we may want to add some tests for the `FixedCapacitySet`?

Yeah, now that it is more likely that this will make it into FX, I will add a small set of unit tests for this class.

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

PR Comment: https://git.openjdk.org/jfx/pull/1316#issuecomment-2128894297


More information about the openjfx-dev mailing list