Navigation Menu

Skip to content
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

8280526: x86_32 Math.sqrt performance regression with -XX:UseSSE={0,1} #7200

Closed
wants to merge 1 commit into from

Conversation

shipilev
Copy link
Member

@shipilev shipilev commented Jan 24, 2022

See more details in the bug.

x86_32 performance:

# ---- Before JDK-8279076

# -XX:UseAVX=0 -XX:UseSSE=0
MathBench.sqrtDouble       0  thrpt    8  406540.546 ± 2299.428  ops/ms

# -XX:UseAVX=0 -XX:UseSSE=1
MathBench.sqrtDouble       0  thrpt    8  408018.332 ± 1423.456  ops/ms

# ---- Current mainline

# -XX:UseAVX=0 -XX:UseSSE=0
MathBench.sqrtDouble       0  thrpt    8    9983.414 ± 426.007  ops/ms

# -XX:UseAVX=0 -XX:UseSSE=1
MathBench.sqrtDouble       0  thrpt    8    9883.518 ± 513.648  ops/ms

# ---- Patched 

# -XX:UseAVX=0 -XX:UseSSE=0
MathBench.sqrtDouble       0  thrpt    8  407267.348 ± 1605.200  ops/ms

# -XX:UseAVX=0 -XX:UseSSE=1
MathBench.sqrtDouble       0  thrpt    8  407500.560 ± 739.249  ops/ms

While this is technically a regression in JDK 18, this is an edge case, so I would bring it to 18.0.1, instead of going into JDK 18 RDP2 process.

Additional testing:

  • Linux x86_64 compiler/c2/TestSqrt.java with -XX:UseAVX=0 -XX:UseSSE=2
  • Linux x86_32 compiler/c2/TestSqrt.java with -XX:UseAVX=0 -XX:UseSSE=0
  • Linux x86_32 compiler/c2/TestSqrt.java with -XX:UseAVX=0 -XX:UseSSE=1
  • Linux x86_32 compiler/c2/TestSqrt.java with -XX:UseAVX=0 -XX:UseSSE=2
  • Linux x86_32 compiler/loopopts/superword/SumRedSqrt_Double.java with -XX:UseAVX=0 -XX:UseSSE=0
  • Linux x86_32 compiler/loopopts/superword/SumRedSqrt_Double.java with -XX:UseAVX=0 -XX:UseSSE=1
  • Linux x86_32 compiler/loopopts/superword/SumRedSqrt_Double.java with -XX:UseAVX=0 -XX:UseSSE=2
  • Linux x86_32 tier1 with -XX:UseAVX=0 -XX:UseSSE=0
  • Linux x86_32 tier1 with -XX:UseAVX=0 -XX:UseSSE=1

Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8280526: x86_32 Math.sqrt performance regression with -XX:UseSSE={0,1}

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/7200/head:pull/7200
$ git checkout pull/7200

Update a local copy of the PR:
$ git checkout pull/7200
$ git pull https://git.openjdk.java.net/jdk pull/7200/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 7200

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/7200.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 24, 2022

👋 Welcome back shade! 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 openjdk bot added the rfr Pull request is ready for review label Jan 24, 2022
@openjdk
Copy link

openjdk bot commented Jan 24, 2022

@shipilev 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.

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Jan 24, 2022
@mlbridge
Copy link

mlbridge bot commented Jan 24, 2022

Webrevs

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

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

Nice catch. Approved. Is MathBench.sqrtDouble existing bench?

@openjdk
Copy link

openjdk bot commented Jan 25, 2022

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

8280526: x86_32 Math.sqrt performance regression with -XX:UseSSE={0,1}

Reviewed-by: kvn, neliasso

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 41 new commits pushed to the master branch:

  • 295c047: 8279242: Reflection newInstance() error message when constructor has no access modifiers could use improvement
  • 841eae6: 8269542: JDWP: EnableCollection support is no longer spec compliant after JDK-8255987
  • 76fe03f: 8280166: Extend java/lang/instrument/GetObjectSizeIntrinsicsTest.java test cases
  • cebaad1: 8280041: Retry loop issues in java.io.ClassCache
  • cbe8395: 8280168: Add Objects.toIdentityString
  • f4575e4: 8279946: (ch) java.nio.channels.FileChannel tryLock and write methods are missing @throws NonWritableChannelException
  • 674a97b: 8280396: G1: Full gc mark stack draining should prefer to make work available to other threads
  • fe77250: 8280414: Memory leak in DefaultProxySelector
  • 496baad: 8280030: [REDO] Parallel: More precise boundary in ObjectStartArray::object_starts_in_range
  • 4503d04: 8280375: G1: Tighten mem region limit in G1RebuildRemSetHeapRegionClosure
  • ... and 31 more: https://git.openjdk.java.net/jdk/compare/d1569111d7077dd95b95aea6c42616f85d85e781...master

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 ready Pull request is ready to be integrated label Jan 25, 2022
Copy link

@neliasso neliasso left a comment

Choose a reason for hiding this comment

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

Looks good.

@shipilev
Copy link
Member Author

Is MathBench.sqrtDouble existing bench?

Yes, accessible with make test TEST="micro:MathBench.sqrtDouble".

@shipilev
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Jan 26, 2022

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

  • e72eefd: 8280531: Remove unused DeferredCloseInputStream
  • 2c64a7f: 8280374: G1: Remove unnecessary prev bitmap mark
  • a183bfb: 8280377: MethodHandleProxies does not correctly invoke default methods with varags
  • 2eab86b: 8213905: reflection not working for type annotations applied to exception types in the inner class constructor
  • 295c047: 8279242: Reflection newInstance() error message when constructor has no access modifiers could use improvement
  • 841eae6: 8269542: JDWP: EnableCollection support is no longer spec compliant after JDK-8255987
  • 76fe03f: 8280166: Extend java/lang/instrument/GetObjectSizeIntrinsicsTest.java test cases
  • cebaad1: 8280041: Retry loop issues in java.io.ClassCache
  • cbe8395: 8280168: Add Objects.toIdentityString
  • f4575e4: 8279946: (ch) java.nio.channels.FileChannel tryLock and write methods are missing @throws NonWritableChannelException
  • ... and 35 more: https://git.openjdk.java.net/jdk/compare/d1569111d7077dd95b95aea6c42616f85d85e781...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jan 26, 2022

@shipilev Pushed as commit a24f44d.

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

@shipilev shipilev deleted the JDK-8280526-32bit-sqrt branch January 27, 2022 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
3 participants