JDK-8304420 : Regression ~11% with Javac-Generates on all platforms in b14
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 21
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-03-17
  • Updated: 2024-01-12
  • Resolved: 2023-03-20
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 21
21 b15Fixed
Related Reports
Relates :  
Relates :  
Description
This is referring to the new javac bmks at https://github.com/openjdk/jmh-jdk-microbenchmarks/tree/master/micros-javac

Appeared in retriage of 21-b14. Seems to be related to JDK-8303820
Comments
Changeset: 42723dcb Author: Maurizio Cimadamore <mcimadamore@openjdk.org> Date: 2023-03-20 18:44:20 +0000 URL: https://git.openjdk.org/jdk/commit/42723dcb1862da598092bb499056940d78a8bdac
20-03-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/13104 Date: 2023-03-20 16:42:00 +0000
20-03-2023

Codegen needs access to constant values - perhaps the new code for getting type metadata, which uses streams, is not as fast: ``` public <M extends TypeMetadata> Optional<M> getMetadata(Class<M> metadataClass) { return metadata.stream() .filter(m -> metadataClass.isAssignableFrom(m.getClass())) .map(metadataClass::cast) .findFirst(); } ``` Might be worth trying to replace that with a for loop, and measure again. Also, implementation of `constValue`: ``` public Object constValue() { return getMetadata(TypeMetadata.ConstantValue.class) .map(ConstantValue::value).orElse(null); } ``` Perhaps using stream + optional is not great here.
18-03-2023