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.
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.
- relates to
-
JDK-8338542 Umbrella - Reduce startup overhead associated with migration to ClassFile API
- Resolved
- links to
-
Commit(master) openjdk/jdk/3aeb6733
-
Review(master) openjdk/jdk/20611