-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8316582: Minor startup regression in 22-b15 due JDK-8310929 #15836
Conversation
👋 Welcome back redestad! A progress list of the required criteria for merging this PR into |
This PR vs a 22-b15 baseline:
This PR vs a 22-b14 baseline:
There's still a substantial win compared to 22-b14, stemming from the use of a packed lookup table rather than two disjoint tables for tens and single digit numbers. |
Can #14636 be a solution to avoid early VH initialization? Also curious how you created such a "Base vs Test" metrics table, could you teach me how? |
I think #14636 would more or less solve the startup regression, yes, but the jury is out on whether we want to accept that. There's value in taking steps to make We also really need to analyze why the JIT doesn't generate as good code for pair-wise
It's a tool I've written that parses JMH json output and allows comparisons. It's currently part of a larger benchmark running toolkit that we probably can't open source, but I could probably extract the simple parser + printer and put it under the OpenJDK somewhere if there's interest. |
Startup numbers improve with the above patch to levels on par with 22-b14:
(This is simply a Noop/Hello World program in a loop, with stats collected by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I also wonder if storing digit pairs in platform endianness is better; currently only Unsafe support writing multibytes with platform endianness.
FWIW when initializing
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for tracking down the regression.
/integrate |
@cl4es Your integration request cannot be fulfilled at this time, as the status check |
@cl4es 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:
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 23 new commits pushed to the
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 |
/integrate |
Going to push as commit 913e43f.
Your commit was automatically rebased without conflicts. |
digitPair and Unsafe.putShort are a good combination. Can Unsafe be used here? private static void writeDigitPair(byte[] buf, int charPos, int value) {
UNSAFE.putShortUnaligned(
buf,
Unsafe.ARRAY_BYTE_BASE_OFFSET + charPos,
digitPair(value),
false);
} |
I'd like us to take a step back and instead of reaching for and sprinkling |
This patch reverts the use of
ByteArrayLittleEndian
inStringLatin1
.This use is the cause of a small (~1.5ms) startup regression in 22-b15. While a manageable startup regression in and of itself, the use of
VarHandles
in core utility classes brings an increased risk of bootstrap circularity issues, for example disqualifying the use of things likeIntegers.toString
in some places.Reverting this partially rolls back the performance improvement gained by JDK-8310929. It seems reasonable that the compiler can be enhanced to gain that loss back.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15836/head:pull/15836
$ git checkout pull/15836
Update a local copy of the PR:
$ git checkout pull/15836
$ git pull https://git.openjdk.org/jdk.git pull/15836/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 15836
View PR using the GUI difftool:
$ git pr show -t 15836
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15836.diff