JDK-8338532 : Speed up the ClassFile API MethodTypeDesc#ofDescriptor
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-08-17
  • Updated: 2024-08-26
  • Resolved: 2024-08-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 24
24 b12Fixed
Related Reports
Relates :  
Description
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.
Comments
Changeset: 3aeb6733 Branch: master Author: Shaojin Wen <shaojin.wensj@alibaba-inc.com> Committer: Chen Liang <liach@openjdk.org> Date: 2024-08-21 14:56:30 +0000 URL: https://git.openjdk.org/jdk/commit/3aeb6733f958bc2b0132494b8ac51a4cfa6b98de
21-08-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/20611 Date: 2024-08-16 08:53:38 +0000
19-08-2024

Note that java.lang.constant belongs to the java.lang subcomponent.
17-08-2024