JDK-8339576 : Speed up raw bytecode processing in ClassFile API
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.lang.classfile
  • Affected Version: 24
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-09-05
  • Updated: 2024-09-16
  • Resolved: 2024-09-06
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 b15Fixed
Description
Currently, raw bytecode access goes through multiple wrappers, include one from ClassFile API and another ByteBuffer for merged big endian value reads. We can merge the ByteBuffer into the ClassFile API one (RawBytecodeHelper) for safer access.

RawBytecodeHelper is also restructured so we avoid allocating it on the heap. Large rawNext method is now also inlined into the smaller next method.

Current benchmark results show this significantly speeds up jdk.classfile.Write and some degree of speedup for simple lambda startup. The impact on general application workloads is minuscule, but this doesn't seem to bring any regression.
Comments
Changeset: a1eebbdf Branch: master Author: Chen Liang <liach@openjdk.org> Date: 2024-09-06 11:42:50 +0000 URL: https://git.openjdk.org/jdk/commit/a1eebbdf8a62b641b765bf4cec5066690c11a8e5
06-09-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/20863 Date: 2024-09-04 22:41:38 +0000
05-09-2024