Integrated: 8338532: Speed up the ClassFile API MethodTypeDesc#ofDescriptor

Shaojin Wen duke at openjdk.org
Wed Aug 21 14:59:12 UTC 2024


On Fri, 16 Aug 2024 08:53:38 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.

This pull request has now been integrated.

Changeset: 3aeb6733
Author:    Shaojin Wen <shaojin.wensj at alibaba-inc.com>
Committer: Chen Liang <liach at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/3aeb6733f958bc2b0132494b8ac51a4cfa6b98de
Stats:     263 lines in 11 files changed: 152 ins; 61 del; 50 mod

8338532: Speed up the ClassFile API MethodTypeDesc#ofDescriptor

Reviewed-by: redestad, liach

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

PR: https://git.openjdk.org/jdk/pull/20611


More information about the core-libs-dev mailing list