RFR: 8304420: Regression ~11% with Javac-Generates on all platforms in b14

Maurizio Cimadamore mcimadamore at openjdk.org
Mon Mar 20 17:28:42 UTC 2023


This patch fixes a performance regression introduced by  JDK-8303820. The new code for dealing with type metadata makes excessive use of streams and optionals, leading to performance degradation. I've tweaked the code to use plain for loops, and also to use `null` instead of optionals. I've also added a new `getMetadata` method which accepts a map function (if metadata is found) as well as a default value (if metadata is not found) which makes usage from clients similar to just using optionals. This seems to revert performance numbers to what they were before the fix.

-------------

Commit messages:
 - Re-add sealed modifier
 - Drop spurious changes
 - Initial push

Changes: https://git.openjdk.org/jdk/pull/13104/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=13104&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8304420
  Stats: 33 lines in 2 files changed: 17 ins; 2 del; 14 mod
  Patch: https://git.openjdk.org/jdk/pull/13104.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13104/head:pull/13104

PR: https://git.openjdk.org/jdk/pull/13104


More information about the compiler-dev mailing list