RFR: 8338546: Speed up ConstantPoolBuilder::classEntry(ClassDesc) [v2]

Claes Redestad redestad at openjdk.org
Thu Aug 22 13:48:07 UTC 2024


On Thu, 22 Aug 2024 13:35:28 GMT, Chen Liang <liach at openjdk.org> wrote:

>> Speed up `ConstantPoolBuilder::classEntry(ClassDesc)` by going through `ClassDesc` comparison and reusing descriptor hash to calculate internal name hash if possible. No suitable device to run benchmarks so need to find something to run the new benchmark to ensure things work as intended.
>
> Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
> 
>  - Improve benchmark as suggested
>  - Merge branch 'master' of https://github.com/openjdk/jdk into feature/classentry-speedup
>  - Fix microbenchmark
>  - Improve jmh
>  - 8338546: Speed up ConstantPoolBuilder::classEntry(ClassDesc)

src/java.base/share/classes/jdk/internal/classfile/impl/Util.java line 372:

> 370:      * }
> 371:      * }
> 372:      * This is converted to explicit initialization to avoid bootstrap overhead.

Have you measured this to be true and useful? Static array initializers are bulky at a bytecode level so sometimes just generating on the fly carries insignicant overhead. Then the `UtilTest` assertion test wouldn't really be needed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20667#discussion_r1727092745


More information about the core-libs-dev mailing list