Skip to content

8362596: RISC-V: Improve _vectorizedHashCode intrinsic #26409

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ygaevsky
Copy link
Contributor

@ygaevsky ygaevsky commented Jul 21, 2025

This is a micro-optimization for RISC-V SpacemiT K1 CPU to fix encountered performance regression.


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-8362596: RISC-V: Improve _vectorizedHashCode intrinsic (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 26409

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 21, 2025

👋 Welcome back ygaevsky! 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.

@openjdk
Copy link

openjdk bot commented Jul 21, 2025

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

8362596: RISC-V: Improve _vectorizedHashCode intrinsic

Reviewed-by: fyang, fjiang

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 45 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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@RealFYang, @feilongjiang) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 21, 2025
@openjdk
Copy link

openjdk bot commented Jul 21, 2025

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

  • hotspot-compiler

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.

@ygaevsky
Copy link
Contributor Author

bpif3-16g% for i in "-XX:DisableIntrinsic=_vectorizedHashCode" "-XX:-UseRVV" "-XX:+UseRVV" ; \
    do ( echo "--- ${i} ---" && ${JAVA_HOME}/bin/java  -jar benchmarks.jar  \
	--jvmArgs="-XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions ${i}" \
	org.openjdk.bench.java.lang.ArraysHashCode.ints  \
	-p size=1,5,10,20,30,40,50,60,70,80,90,100,200,300 \
	-f 3 -r 1 -w 1 -wi 5 -i 10 2>&1 | tail -15 ) done
--- -XX:DisableIntrinsic=_vectorizedHashCode ---
Benchmark            (size)  Mode  Cnt    Score   Error  Units
ArraysHashCode.ints       1  avgt   30   11.280 ± 0.004  ns/op
ArraysHashCode.ints       5  avgt   30   28.831 ± 0.032  ns/op
ArraysHashCode.ints      10  avgt   30   41.179 ± 0.220  ns/op
ArraysHashCode.ints      20  avgt   30   68.178 ± 0.142  ns/op
ArraysHashCode.ints      30  avgt   30   88.911 ± 0.385  ns/op
ArraysHashCode.ints      40  avgt   30  115.043 ± 0.186  ns/op
ArraysHashCode.ints      50  avgt   30  135.755 ± 0.607  ns/op
ArraysHashCode.ints      60  avgt   30  161.924 ± 0.187  ns/op
ArraysHashCode.ints      70  avgt   30  170.367 ± 0.413  ns/op
ArraysHashCode.ints      80  avgt   30  193.985 ± 0.707  ns/op
ArraysHashCode.ints      90  avgt   30  207.633 ± 0.147  ns/op
ArraysHashCode.ints     100  avgt   30  232.362 ± 0.259  ns/op
ArraysHashCode.ints     200  avgt   30  447.390 ± 0.677  ns/op
ArraysHashCode.ints     300  avgt   30  656.324 ± 1.100  ns/op
--- -XX:-UseRVV ---
Benchmark            (size)  Mode  Cnt    Score   Error  Units
ArraysHashCode.ints       1  avgt   30   11.291 ± 0.017  ns/op
ArraysHashCode.ints       5  avgt   30   23.176 ± 0.011  ns/op
ArraysHashCode.ints      10  avgt   30   33.264 ± 0.073  ns/op
ArraysHashCode.ints      20  avgt   30   50.726 ± 0.006  ns/op
ArraysHashCode.ints      30  avgt   30   70.990 ± 0.184  ns/op
ArraysHashCode.ints      40  avgt   30   88.368 ± 0.050  ns/op
ArraysHashCode.ints      50  avgt   30  108.582 ± 0.175  ns/op
ArraysHashCode.ints      60  avgt   30  126.084 ± 0.202  ns/op
ArraysHashCode.ints      70  avgt   30  146.201 ± 0.169  ns/op
ArraysHashCode.ints      80  avgt   30  163.469 ± 0.033  ns/op
ArraysHashCode.ints      90  avgt   30  183.653 ± 0.182  ns/op
ArraysHashCode.ints     100  avgt   30  201.063 ± 0.156  ns/op
ArraysHashCode.ints     200  avgt   30  389.657 ± 0.752  ns/op
ArraysHashCode.ints     300  avgt   30  577.283 ± 0.434  ns/op
--- -XX:+UseRVV ---
Benchmark            (size)  Mode  Cnt    Score   Error  Units
ArraysHashCode.ints       1  avgt   30   11.273 ± 0.001  ns/op
ArraysHashCode.ints       5  avgt   30   23.184 ± 0.010  ns/op
ArraysHashCode.ints      10  avgt   30   33.262 ± 0.086  ns/op
ArraysHashCode.ints      20  avgt   30   50.811 ± 0.078  ns/op
ArraysHashCode.ints      30  avgt   30   71.019 ± 0.164  ns/op
ArraysHashCode.ints      40  avgt   30   88.331 ± 0.096  ns/op
ArraysHashCode.ints      50  avgt   30  108.852 ± 0.212  ns/op
ArraysHashCode.ints      60  avgt   30  125.948 ± 0.039  ns/op
ArraysHashCode.ints      70  avgt   30  146.518 ± 0.345  ns/op
ArraysHashCode.ints      80  avgt   30  163.464 ± 0.029  ns/op
ArraysHashCode.ints      90  avgt   30  183.722 ± 0.237  ns/op
ArraysHashCode.ints     100  avgt   30  201.307 ± 0.346  ns/op
ArraysHashCode.ints     200  avgt   30  389.048 ± 0.322  ns/op
ArraysHashCode.ints     300  avgt   30  576.821 ± 0.130  ns/op

@mlbridge
Copy link

mlbridge bot commented Jul 21, 2025

Webrevs

Copy link
Member

@RealFYang RealFYang left a comment

Choose a reason for hiding this comment

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

Thanks!

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jul 21, 2025
Copy link
Member

@feilongjiang feilongjiang left a comment

Choose a reason for hiding this comment

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

Thanks for finding this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler [email protected] ready Pull request is ready to be integrated rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

3 participants