JDK-8309611 : Speed up MethodType::describeConstable
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang.invoke
  • Affected Version: 21
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2023-06-07
  • Updated: 2024-06-28
  • Resolved: 2024-06-22
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
24Resolved
Related Reports
Duplicate :  
Description
In the benchmarks in JDK-8309413, MethodTypeDesc creation from individual ClassDesc is signifcantly faster than from a descriptor string. We should remove streams in the describeConstable implementation to speed it up and ask users to favor .describeConstable().orElseThrow() over toMethodDescriptorString + ofDescriptor. In addition, we can pass the computed descriptor string to the MTD to speed its descriptorString up as well.
Comments
This is included in the changeset for JDK-8294960.
20-04-2024

I believe this is motivated by https://github.com/openjdk/jdk/pull/12945, which is still draft. The performance of java.lang.invoke using the ClassFile API is critical. I suggest to consider all performance improvement ideas under the development of JDK-8294960 first. When it's ready for review, it can then separate the patch into multiple PRs if appropriate.
07-06-2023