Skip to content

8383559: [lworld] Autobox cache removal causes performance regression with Renaissance benchmarks#2390

Closed
TobiHartmann wants to merge 4 commits into
openjdk:lworldfrom
TobiHartmann:JDK-8383559
Closed

8383559: [lworld] Autobox cache removal causes performance regression with Renaissance benchmarks#2390
TobiHartmann wants to merge 4 commits into
openjdk:lworldfrom
TobiHartmann:JDK-8383559

Conversation

@TobiHartmann
Copy link
Copy Markdown
Member

@TobiHartmann TobiHartmann commented May 5, 2026

To re-enable the autobox cache, this patch reverts (parts of) JDK-8369921, JDK-8378476, deopt parts of JDK-8378531 and JDK-8379148.

I had to modify the newCacheArray methods to return a non-flattened array to avoid buffering.

I wasn't sure about the comments above the valueOf methods:
b3ccb6a#diff-6136f7a80110ec00bf9a0b7da9943eb2fc33025ab400bc1f70153c1b2ac36993R146

Should they be reverted too? For now, I left them as is.

Thanks,
Tobias



Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (1 review required, with at least 1 Committer)

Issue

  • JDK-8383559: [lworld] Autobox cache removal causes performance regression with Renaissance benchmarks (Bug - P2)

Reviewers

Contributors

  • Ioi Lam <iklam@openjdk.org>

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/2390/head:pull/2390
$ git checkout pull/2390

Update a local copy of the PR:
$ git checkout pull/2390
$ git pull https://git.openjdk.org/valhalla.git pull/2390/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2390

View PR using the GUI difftool:
$ git pr show -t 2390

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/2390.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented May 5, 2026

👋 Welcome back thartmann! A progress list of the required criteria for merging this PR into lworld will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 5, 2026

@TobiHartmann This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8383559: [lworld] Autobox cache removal causes performance regression with Renaissance benchmarks

Co-authored-by: Ioi Lam <iklam@openjdk.org>
Reviewed-by: iklam, matsaave, liach

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 3 new commits pushed to the lworld branch:

  • 6b9eb7d: 8384283: [lworld] Post-parse call devirtualization with unloaded return type fails
  • de6aff4: 8384364: [lworld] C2: assert(cloned_flat_array_check->req() == 3) failed: unexpected number of inputs for FlatArrayCheck
  • 2d330b1: 8384193: [lworld] Remove identity field from java.lang.Class

Please see this link for an up-to-date comparison between the source branch of this pull request and the lworld branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the lworld branch, type /integrate in a new comment.

@TobiHartmann TobiHartmann marked this pull request as ready for review May 5, 2026 15:13
@openjdk openjdk Bot added the rfr Pull request is ready for review label May 5, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented May 5, 2026

Webrevs

Comment thread src/hotspot/share/opto/type.cpp Outdated
Comment thread src/java.base/share/classes/java/lang/Short.java
Copy link
Copy Markdown
Member

@Arraying Arraying left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code changes look good overall, thanks! Maybe @matias9927 knows more about the AOT-specifics here and can weigh in as well.

I don't really have the expertise on specification to weigh in, but it seems like Victor has already pointed out some mistakes.

Comment thread src/hotspot/share/runtime/deoptimization.cpp
Comment thread src/java.base/share/classes/java/lang/Character.java Outdated
Comment thread src/java.base/share/classes/java/lang/Integer.java Outdated
assert cache.length == size;
}

private static Byte[] newCacheArray(int size) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this - we should be able to revert to mainline code. The only code I think that need any update would be the old new Byte[size] should become (Byte[]) ValueClass.newReferenceArray(Byte.class, size) both with and without preview.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new Byte[size] should become (Byte[]) ValueClass.newReferenceArray(Byte.class, size) both with and without preview.

@liach That's not possible because ValueClass.newReferenceArray throws when preview is disabled because boxes are identity classes then.

Comment thread src/java.base/share/classes/java/lang/Byte.java Outdated
@liach
Copy link
Copy Markdown
Member

liach commented May 6, 2026

For JDK-8383894, I think we need to move the @DeserializeConstructor annotations from the valueOf methods to the constructors to eliminate that particular regression. Can you include that in your patch?

@TobiHartmann
Copy link
Copy Markdown
Member Author

Thanks for the reviews! I've been working on https://git.openjdk.org/valhalla/pull/2406 which was blocking this PR and will get to this next week.

@TobiHartmann
Copy link
Copy Markdown
Member Author

I think we need to move the @DeserializeConstructor annotations from the valueOf methods to the constructors to eliminate that particular regression. Can you include that in your patch?

Done. Maybe @kuksenko could verify that this solves JDK-8383894.

@TobiHartmann
Copy link
Copy Markdown
Member Author

/contributor add @iklam

@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 13, 2026

@TobiHartmann
Contributor Ioi Lam <iklam@openjdk.org> successfully added.

@TobiHartmann
Copy link
Copy Markdown
Member Author

Thanks for the reviews! I addressed all comments and will re-run testing.

@@ -25,7 +25,6 @@
/*
* @test
* @summary Test primitive box caches integrity in various scenarios (IntegerCache etc)
* @requires !java.enablePreview
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure that there are no other tests that need their requires-clauses updated as a part of this change?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a quick look and nothing else stood out. But I defer to people more familiar in this area.

@TobiHartmann
Copy link
Copy Markdown
Member Author

If there are no strong objections, I propose to integrate this as is because some other work depends on it. I would leave it to the core-libs / CDS experts to follow-up with more cleanups.

Copy link
Copy Markdown
Member

@iklam iklam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CDS changes look OK.

@openjdk openjdk Bot added the ready Pull request is ready to be integrated label May 13, 2026
Copy link
Copy Markdown
Contributor

@matias9927 matias9927 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CDS changes look good!

Copy link
Copy Markdown
Member

@liach liach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Core libs updates look good.

@TobiHartmann
Copy link
Copy Markdown
Member Author

Thanks for the reviews. I'll wait for testing to all pass before integrating (probably only on Friday because Thursday is a public holiday here).

@TobiHartmann
Copy link
Copy Markdown
Member Author

/integrate

@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 15, 2026

Going to push as commit 50ed255.
Since your change was applied there have been 6 commits pushed to the lworld branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk Bot added the integrated Pull request has been integrated label May 15, 2026
@openjdk openjdk Bot closed this May 15, 2026
@openjdk openjdk Bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels May 15, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 15, 2026

@TobiHartmann Pushed as commit 50ed255.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

6 participants