RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes [v5]
Adam Sotona
asotona at openjdk.org
Wed Mar 22 17:12:05 UTC 2023
On Thu, 9 Mar 2023 17:53:05 GMT, Mandy Chung <mchung at openjdk.org> wrote:
>> Adam Sotona has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 195 commits:
>>
>> - Merge branch 'master' into JDK-8294961-proxy
>> - Merge branch 'JDK-8294982' into JDK-8294961
>> - removed obsolete javadoc from implementation classes
>> - minor fix in CodeBuilder and added test cases to LDCTest
>> - EntryMap::nextPowerOfTwo delegates to Long:numberOfLeadingZeros
>> - fixed CodeBuilder:constantInstruction for -0.0d and -0.0f values and added test
>> - Merge branch 'master' into JDK-8294982
>> - fixed new lines at end of file
>> - package jdk.internal.classfile.jdktypes moved to jdk.internal.classfile.java.lang.constant
>> - fixed CodeRelabeler javadoc
>> - ... and 185 more: https://git.openjdk.org/jdk/compare/cdcf5c1e...48ac16f8
>
> This change looks good. Have you compared the performance in generating dynamic proxies before and after?
>
> `test/micro/org/openjdk/bench/java/lang/reflect/Proxy/ProxyPerf.java` compares `ProxyGenerator` with `ProxyGenerator_v49` which was the old implementation before converting to ASM. You may consider leveraging this benchmark.
Thanks @mlchung I've run part of `test/micro/org/openjdk/bench/java/lang/reflect/Proxy/ProxyPerf.java` to compare performance with existing implementation and unfortunately I've discovered significant regressions.
The most significant regressions are caused by repeated conversions between `String` and `ClassDesc` or `MethodTypeDesc`. Repetitiveness of the conversions can be fixed, speed of the conversions can be improved, however there will be still remaining overhead, mainly in embedded validation.
Another clearly visible CPU consumer is class hierarchy resolution, where correct caching scope and caching methods play important roles.
In the following patches I'll focus on cutting the performance regression down as much as possible.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/10991#issuecomment-1479943761
More information about the core-libs-dev
mailing list