-
Bug
-
Resolution: Fixed
-
P3
-
21, 25
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8360413 | 25 | Coleen Phillimore | P3 | Resolved | Fixed | b29 |
Field access causes iteration through all fields in InstanceKlass::find_local_field(...). After
Moreover, when we call fd->reinitialize(...) the field lookup by index results in another iteration through the fields rather than O(1) access.
I am attaching a reproducer; this creates a class with 21,000 fields, compiles it and executes this (all that the class does is to initialize
all its fields). On JDK 17 running this reports 581 ms; on JDK 21 the test takes 8017 ms on my laptop.
I was able to avoid the second iteration by passing FieldInfo to reinitialize() and the execution went down to 5712 ms, but I don't see a simple solution that would make the first iteration more efficient.
hotspot-dev reference: https://mail.openjdk.org/pipermail/hotspot-dev/2025-March/102679.html
- backported by
-
JDK-8360413 Perf regression accessing fields
-
- Resolved
-
- caused by
-
JDK-8292818 replace 96-bit representation for field metadata with variable-sized streams
-
- Resolved
-
- duplicates
-
JDK-8352169 Perf regression accessing fields
-
- Closed
-
- relates to
-
JDK-8353175 Eliminate double iteration of stream in FieldDescriptor reinitialization
-
- Resolved
-
- links to
-
Commit(jdk25) openjdk/jdk/0694cc1d
-
Commit(master) openjdk/jdk/e18277b4
-
Review(jdk25) openjdk/jdk/25877
-
Review(master) openjdk/jdk/24713
-
Review(master) openjdk/jdk/24847