Skip to content

8299671: speed up compiler/intrinsics/string/TestStringLatin1IndexOfChar.java #11862

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

Closed
wants to merge 2 commits into from

Conversation

eme64
Copy link
Contributor

@eme64 eme64 commented Jan 5, 2023

This test took very long, it was the slowest compiler test.
In total it took almost 3 minutes on my laptop. Now it is down to half a minute. The run statements also are about 10x faster now.

We could parallelize the run statements, but given that it is already fairly small the benefit is not so big, and it would imply overheads of parallelization, like loading libraries multiple times.

Goal of this test: trigger indexOfChar intrinsic inside the test functions. To trigger this reliably without too many repetitions of the test functions, we had set the flags -XX:Tier4InvocationThreshold=200 -XX:CompileThreshold=100. But this also triggers lots of other compilations, and makes everything slow.

I removed those flags, and used the white-box API to trigger compilation of the test functions. With sufficient warm-up, the paths to the intrinsic is hot, and we get intrinsification of indexOfChar.


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-8299671: Speed up compiler/intrinsics/string/TestStringLatin1IndexOfChar.java

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 11862

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 5, 2023

👋 Welcome back epeter! 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 Jan 5, 2023

@eme64 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 5, 2023
@eme64 eme64 marked this pull request as ready for review January 5, 2023 15:26
@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 5, 2023
@mlbridge
Copy link

mlbridge bot commented Jan 5, 2023

Webrevs

* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:DisableIntrinsic=_indexOfL_char compiler.intrinsics.string.TestStringLatin1IndexOfChar
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:UseSSE=0 compiler.intrinsics.string.TestStringLatin1IndexOfChar
Copy link
Contributor

Choose a reason for hiding this comment

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

I think -XX:UseSSE=0 was typo in original changes. It should be -XX:UseAVX=0 because we don't support anything less than SSE2 with 64-bit VM.
StrIndexOf is only supported when UseSSE42Intrinsics == true for both 32- and 64-bit VMs. See x86_*.ad files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I replaced it.

@eme64 eme64 requested a review from vnkozlov January 6, 2023 08:01
Copy link
Member

@TobiHartmann TobiHartmann 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 to me.

@openjdk
Copy link

openjdk bot commented Jan 6, 2023

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

8299671: speed up compiler/intrinsics/string/TestStringLatin1IndexOfChar.java

Reviewed-by: thartmann, kvn

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

  • 3dcf700: 8299336: InputStream::DEFAULT_BUFFER_SIZE should be 16384
  • 1e99729: 8299274: Add elements to resolved_references consistently
  • 8cc1669: 8299721: [Vector API] assert in switch-default of LibraryCallKit::arch_supports_vector_rotate is too weak to catch bugs
  • 5598acc: 8294403: [REDO] make test should report only on executed tests
  • 88f0ea7: 8299726: [cleanup] Some code cleanup in opto/compile.hpp
  • 0234f81: 8298447: Unnecessary Vector usage in DocPrintJob implementations
  • cc4936a: 8298720: Insufficient error handling when CodeBuffer is exhausted
  • b5b7948: 8298240: Replace the usage of ImageLayoutException by the CMMException
  • 99be740: 8299306: Test "javax/swing/JFileChooser/FileSystemView/CustomFSVLinkTest.java" fails on Windows 10 x64 because there are some buttons did not display button name
  • 775da84: 8299412: JNI call of getAccessibleActionCount on a wrong thread
  • ... and 7 more: https://git.openjdk.org/jdk/compare/872384707e89d03ede655aad16f360dc94f10152...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 6, 2023
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.

Good.

@eme64
Copy link
Contributor Author

eme64 commented Jan 9, 2023

@TobiHartmann @vnkozlov Thanks for the help and reviews!
/integrate

@openjdk
Copy link

openjdk bot commented Jan 9, 2023

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

  • 05a0a71: 8297933: [REDO] Compiler should only use verified interface types for optimization
  • 9b1ade8: 8295406: C1 crash with -XX:TypeProfileArgsLimit=0 -XX:TypeProfileLevel=222
  • 8d17d1e: 6914801: IPv6 unavailable if stdin is a socket
  • d03a5d9: 8299593: getprotobyname should not be used
  • c444922: 8218474: JComboBox display issue with GTKLookAndFeel
  • 7607c07: 8299774: SYNTH_BUTTON_UI_KEY field is unused
  • d53cac3: 8299481: Remove metaprogramming/removePointer.hpp
  • 834e50e: 8298921: Create a regression test for JDK-8139581
  • e209693: 8258776: ThreadLocal#initialValue() Javadoc is unaware of ThreadLocal#withInitial()
  • d5b80ab: 8299617: CurrencySymbols.properties is missing the copyright notice
  • ... and 31 more: https://git.openjdk.org/jdk/compare/872384707e89d03ede655aad16f360dc94f10152...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jan 9, 2023

@eme64 Pushed as commit d2827ec.

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

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
Development

Successfully merging this pull request may close these issues.

3 participants