On Wed, 21 Aug 2024 22:27:02 GMT, Chen Liang <li...@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. Current benchmark results on mac aarch64, where `oldStyleLookup` is the performance of the current `classEntry(ClassDesc)`: Benchmark Mode Cnt Score Error Units ConstantPoolBuildingClassEntry.identicalLookup thrpt 5 112.603 ± 0.514 ops/ms ConstantPoolBuildingClassEntry.internalNameLookup thrpt 5 239.761 ± 0.190 ops/ms ConstantPoolBuildingClassEntry.nonIdenticalLookup thrpt 5 169.954 ± 0.606 ops/ms ConstantPoolBuildingClassEntry.oldStyleLookup thrpt 5 81.993 ± 4.942 ops/ms Windows x64: Benchmark Mode Cnt Score Error Units ConstantPoolBuildingClassEntry.identicalLookup thrpt 5 134.546 ± 0.835 ops/ms ConstantPoolBuildingClassEntry.internalNameLookup thrpt 5 201.743 ± 1.236 ops/ms ConstantPoolBuildingClassEntry.nonIdenticalLookup thrpt 5 134.512 ± 1.655 ops/ms ConstantPoolBuildingClassEntry.oldStyleLookup thrpt 5 78.647 ± 0.370 ops/ms For some reason identity matching case hurts, but the other x64 platforms are much less affected. @cl4es would you know why these compiled benchmarks would behave so? ------------- PR Comment: https://git.openjdk.org/jdk/pull/20667#issuecomment-2303783382