RFR: JDK-8199216: Quadratic layout time with nested nodes and pseudo-class in style sheet [v8]

John Hendrikx jhendrikx at openjdk.org
Wed Aug 16 14:04:46 UTC 2023


On Wed, 16 Aug 2023 05:02:36 GMT, Nir Lisker <nlisker at openjdk.org> wrote:

>> Almost, but the key is also the copied set.  In your version the key is the original object, which may be a modifiable set.  If the key is modified, the cache will not function correctly anymore.
>> 
>> I had a different version before, but @mstr2 pointed out that there was an unnecessary allocation in that version which this version avoids.
>
> Then the map is just an optimization? If the set points to itself then a `Set` as a cache should be enough.

No, a `Set` wouldn't work here, for this reason:

      if (CACHE.contains(mutableSet)) {
             return ... // how do I get the immutable set from CACHE when it is a Set?
      }

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1076#discussion_r1295967620


More information about the openjfx-dev mailing list