Skip to content

Conversation

minborg
Copy link
Contributor

@minborg minborg commented Dec 4, 2024

This PR proposes to fix a performance regression (on x64 platforms) for 32-bit strings introduced by JDK-8345120.

The PR also fixes a performance regression in the benchmarks caused by using the wrong type for MemorySegment.

Regrettably, this PR uses different code paths for various architectures. This gives optimum performance for all platforms at the expense of slightly more code complexity. More specifically, the PR gives a ~15% performance improvement on x64 platforms for longer 32-bit strings.

Passes tier1-tier3.


Progress

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

Issue

  • JDK-8345465: Fix performance regression on x64 after JDK-8345120 (Bug - P3)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 22539

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22539.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 4, 2024

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

@minborg minborg marked this pull request as ready for review December 4, 2024 08:41
@openjdk
Copy link

openjdk bot commented Dec 4, 2024

@minborg 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:

8345465: Fix performance regression on x64 after JDK-8345120

Reviewed-by: mcimadamore

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 58 new commits pushed to the master 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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 4, 2024
@openjdk
Copy link

openjdk bot commented Dec 4, 2024

@minborg The following label will be automatically applied to this pull request:

  • core-libs

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.

@mlbridge
Copy link

mlbridge bot commented Dec 4, 2024

Webrevs

@JornVernee
Copy link
Member

What are 'quad-string words'? FWIW, the word 'word' is somewhat ambiguous (although most people seem to interpret it as the size of an address), so you might want to specify in terms of bits/bytes instead.

@minborg
Copy link
Contributor Author

minborg commented Dec 4, 2024

What are 'quad-string words'? FWIW, the word 'word' is somewhat ambiguous (although most people seem to interpret it as the size of an address), so you might want to specify in terms of bits/bytes instead.

Agreed. I've updated to "32-bit strings"

Copy link
Member

@JornVernee JornVernee left a comment

Choose a reason for hiding this comment

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

I'm a little bit confused by the numbers, which are for AArch64, while the patch fixes a regression on x64. Can you share any numbers on x64? Do you have an idea why long scanning doesn't help on x64?

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 10, 2024
@minborg
Copy link
Contributor Author

minborg commented Dec 10, 2024

/integrate

@openjdk
Copy link

openjdk bot commented Dec 10, 2024

Going to push as commit 06c44dd.
Since your change was applied there have been 58 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 10, 2024
@openjdk openjdk bot closed this Dec 10, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 10, 2024
@openjdk
Copy link

openjdk bot commented Dec 10, 2024

@minborg Pushed as commit 06c44dd.

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

@minborg
Copy link
Contributor Author

minborg commented Dec 10, 2024

/backport :jdk24

@openjdk
Copy link

openjdk bot commented Dec 10, 2024

@minborg the backport was successfully created on the branch backport-minborg-06c44dd5-jdk24 in my personal fork of openjdk/jdk. To create a pull request with this backport targeting openjdk/jdk:jdk24, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 06c44dd5 from the openjdk/jdk repository.

The commit being backported was authored by Per Minborg on 10 Dec 2024 and was reviewed by Maurizio Cimadamore.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk:

$ git fetch https://github.com/openjdk-bots/jdk.git backport-minborg-06c44dd5-jdk24:backport-minborg-06c44dd5-jdk24
$ git checkout backport-minborg-06c44dd5-jdk24
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk.git backport-minborg-06c44dd5-jdk24

⚠️ @minborg You are not yet a collaborator in my fork openjdk-bots/jdk. An invite will be sent out and you need to accept it before you can proceed.

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

Labels

core-libs [email protected] integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants