RFR: 8331291: java.lang.classfile.Attributes class performs a lot of static initializations [v10]
Claes Redestad
redestad at openjdk.org
Fri May 24 10:29:05 UTC 2024
On Fri, 24 May 2024 08:24:15 GMT, Adam Sotona <asotona at openjdk.org> wrote:
>> Hi,
>> During performance optimization work on Class-File API as JDK lambda generator we found some static initialization killers.
>> One of them is `java.lang.classfile.Attributes` with tens of static fields initialized with individual attribute mappers, and common set of all mappers, and static map from attribute names to the mappers.
>>
>> I propose to turn all the static fields into lazy-initialized static methods and remove `PREDEFINED_ATTRIBUTES` and `standardAttribute(Utf8Entry name)` static mapping method from the `Attributes` API class.
>>
>> Please let me know your comments or objections and please review the [PR](https://github.com/openjdk/jdk/pull/19006) and [CSR](https://bugs.openjdk.org/browse/JDK-8331414), so we can make it into 23.
>>
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 16 commits:
>
> - fixed jdeps.Dependencies
> - Merge branch 'master' into JDK-8331291-attributes
> - addressed CSR review comments
> - fixed CompilationIDMapper does not allow multiple instances
> - fixed tests
> - fixed tests
> - fixed tests
> - updated LimitsTest
> - Merge branch 'master' into JDK-8331291-attributes
>
> # Conflicts:
> # test/jdk/jdk/classfile/SignaturesTest.java
> - Merge branch 'master' into JDK-8331291-attributes
> - ... and 6 more: https://git.openjdk.org/jdk/compare/239c1b33...37f7f63f
Looks good after revisions.
-------------
Marked as reviewed by redestad (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/19006#pullrequestreview-2076508421
More information about the hotspot-compiler-dev
mailing list