-
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
8273585: String.charAt performance degrades due to JDK-8268698 #6096
Conversation
👋 Welcome back yyang! A progress list of the required criteria for merging this PR into |
@kelthuzadx The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
src/hotspot/share/opto/loopnode.cpp
Outdated
incr2 == incr || | ||
incr2->Opcode() != Op_AddI || | ||
!incr2->in(2)->is_Con()) | ||
continue; | ||
|
||
if (incr2->in(1) != phi2) { |
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.
You could use incr2->in(1)->uncast() != phi2. You don't need to add an extra if then.
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.
Since the semantic of uncast is enough clear, I also remove the comment.
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 to me.
@kelthuzadx 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 171 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 |
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.
Good.
While a good fix to an issue that seems more likely to be of real concern, this does not seem to remedy the comparatively minor performance issue reported by JDK-8272493 |
@cl4es Thanks for confirmation. I'd like to investigate JDK-8272493 later to see what's the real cause for that one. |
/integrate |
Going to push as commit b0d1e4f.
Your commit was automatically rebased without conflicts. |
@kelthuzadx Pushed as commit b0d1e4f. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
String.charAt shows significant performance regression due to JDK-8268698, which replaces index bound checking with Preconditions.checkIndex intrinsic method.
The result of "time linux-x86_64-server-release/images/jdk/bin/java Test":
The reason is Preconditions.checkIndex generates a CastII for index node as index is now known to be >= 0 and < length.:
jdk/src/hotspot/share/opto/library_call.cpp
Lines 1077 to 1083 in 5dab76b
CastII can not be recognized as a parallel induction variable because AddNode's input must be the PhiNode:
jdk/src/hotspot/share/opto/loopnode.cpp
Lines 3177 to 3184 in 5dab76b
It seems this prevents further loop unrolling. I think we can relax this constraint, i.e CastII can be the input of AddNode if its input is PhiNode. After applying this patch, performance regression disappears:
This is likely the reason for JDK-8272493. Please help review it. Thanks!
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6096/head:pull/6096
$ git checkout pull/6096
Update a local copy of the PR:
$ git checkout pull/6096
$ git pull https://git.openjdk.java.net/jdk pull/6096/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 6096
View PR using the GUI difftool:
$ git pr show -t 6096
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6096.diff