On Fri, 17 Apr 2026 13:09:29 GMT, Frederic Parain <[email protected]> wrote:

> The addition of the NULLABLE_NON_ATOMIC_FLAT layout forced the addition of a 
> null-marker in all value classes instances, causing a instance size increase 
> for value classes which didn't supported any nullable layout before. This 
> size increase caused some performance regressions which boxing classes Double 
> and Long. This patch temporarily disables the support for the 
> NULLABLE_NON_ATOMIC_FLAT layout in classes Long and Double. A longer term 
> solution will be developed and is tracked by JDK-8382361.
> 
> Tested on Mach5: tiers 1-4
> Thanks to @dafedafe for measuring the performance with the fix.
> 
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

That looks reasonable, thanks for addressing this!

src/hotspot/share/classfile/fieldLayoutBuilder.cpp line 1221:

> 1219:     // Note about the special case of j.l.Double and j.l.Long: the 
> introduction of
> 1220:     // the NULLABLE_NON_ATOMIC_FLAT layout caused an increase of the 
> size of their
> 1221:     // instances which causes performance regression (see JDK-8379145)

Suggestion:

    // instances which causes performance regression (see JDK-8379145).

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

Marked as reviewed by chagedorn (Committer).

PR Review: 
https://git.openjdk.org/valhalla/pull/2331#pullrequestreview-4129224427
PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2331#discussion_r3100681529

Reply via email to