RFR: 8352075: Perf regression accessing fields [v4]
Radim Vansa
rvansa at openjdk.org
Mon May 5 13:59:48 UTC 2025
On Mon, 5 May 2025 13:44:32 GMT, Hannes Greule <hgreule at openjdk.org> wrote:
>> For the record, in the ideal case I would like to backport this into JDK 21 as well. Do you think that the change in iteration order would be problematic for that?
>
>> For the record, in the ideal case I would like to backport this into JDK 21 as well. Do you think that the change in iteration order would be problematic for that?
>
> I think that also affects iteration order of Java methods like `Class#getDeclaredFields()` etc.? While the order is unspecified there, I'm pretty certain that it would break existing code. But even worse, [JVM TI specifies that `GetClassFields` returns fields in the order they occur in the class file](https://docs.oracle.com/en/java/javase/21/docs/specs/jvmti.html#GetClassFields). I assume this is currently broken?
@SirYwell Oh, that's correct. I haven't noticed that requirement; I guess that this means that the PR needs to be updated.
How does the order of iteration cooperate with `@Contended`, though? In `FieldLayoutBuilder::regular_field_sorting` we separate static and contended fields; doesn't that break the requirement?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24847#issuecomment-2851099200
More information about the serviceability-dev
mailing list