RFR: 8338532: Speed up the ClassFile API MethodTypeDesc#ofDescriptor [v3]

Shaojin Wen duke at openjdk.org
Tue Aug 20 16:17:56 UTC 2024


On Tue, 20 Aug 2024 12:39:14 GMT, Shaojin Wen <duke at openjdk.org> wrote:

>> The current implementation of ofDescriptor puts return type and parameter types together in an ArrayList, and then splits them into return type and array of parameter types. This ArrayList creation is unnecessary, considering most descriptors only have few parameter types.
>> 
>> By splitting return type and parameter types separately and scanning the descriptor first to get the number of parameters, we can just allocate an exact, trusted array for the resulting MethodTypeDesc without copy.
>
> Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   remove specialization for `Ljava/lang/Object;`

Can we use record to simplify ReferenceClassDescImpl?

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

PR Comment: https://git.openjdk.org/jdk/pull/20611#issuecomment-2299239766


More information about the core-libs-dev mailing list