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

8302152: Speed up tests with infinite loops, sleep less #12514

Closed
wants to merge 3 commits into from

Conversation

eme64
Copy link
Contributor

@eme64 eme64 commented Feb 10, 2023

From over 5 sec to about 0.8 sec.

I simply reduced the Thread.sleep.

I verified that the same compilations still happen.

~/Documents/jtreg/bin/jtreg -va -s -jdk:/home/emanuel/Documents/fork5-jdk/build/linux-x64-debug/jdk/ -javaoptions:"-XX:CompileCommand=printcompilation,compiler.loopopts.TestInfLoopNearUsePlacement::test" /home/emanuel/Documents/fork5-jdk/open/test/hotspot/jtreg/compiler/loopopts/TestInfLoopNearUsePlacement.java

    283   32 % !   3       compiler.loopopts.TestInfLoopNearUsePlacement::test @ 39 (61 bytes)
    284   33 % !   4       compiler.loopopts.TestInfLoopNearUsePlacement::test @ 39 (61 bytes)
    286   34   !   4       compiler.loopopts.TestInfLoopNearUsePlacement::test (61 bytes)

On the time measurement that I got initially reported, this test was flagged as especially long-running, with 17 sec. There may well be another issue, but I hope this fix already does the trick. We will see this in a while once I get the new data.

Update
Did the same for 4 more tests. Always ensured that we still have all compilations.

TestStrangeControl.java -> reduced from 5sec to 2sec. Needs sleep of 1sec to ensure we still run all compilations as before.

TestInfiniteLoopNest.java -> reduced from 5sec to 1.5sec.

TestInfiniteLoopCCP.java -> reduced from 4.5sec to 0.8sec.

TestCMoveWithDeadPhi.java -> reduced from 4.3sec to 0.8sec.

I decided to keep the sleep time rather a bit higher than strictly required. in most of these cases 100ms would have been sufficient on my machine already.


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-8302152: Speed up tests with infinite loops, sleep less

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 12514

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 10, 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 Feb 10, 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 Feb 10, 2023
@eme64 eme64 marked this pull request as ready for review February 13, 2023 08:14
@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 13, 2023
@mlbridge
Copy link

mlbridge bot commented Feb 13, 2023

Webrevs

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.

We have several other tests that do the exact same thing (see grep "thread.setDaemon" -r test/hotspot/jtreg/compiler/). Could you adjust them as well (and update the scope/description of the RFE accordingly)?

@eme64 eme64 changed the title 8302152: Speed up compiler/loopopts/TestInfLoopNearUsePlacement.java 8302152: Speed up tests with infinite loops, sleep less Feb 13, 2023
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.

Thanks, looks good. You also need to update the copyright dates.

@openjdk
Copy link

openjdk bot commented Feb 13, 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:

8302152: Speed up tests with infinite loops, sleep less

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

  • f4d4fa5: 8300255: Introduce interface for GC oop verification in the assembler
  • 99b6c0e: 8302289: RISC-V: Use bgez instruction in arraycopy_simple_check when possible
  • 57aef85: 8301838: PPC: continuation yield intrinsic: exception check not needed if yield succeeded
  • df93880: 8301942: java/net/httpclient/DigestEchoClientSSL.java fail with -Xcomp
  • 0025764: 8040793: vmTestbase/nsk/monitoring/stress/lowmem fails on calling isCollectionUsageThresholdExceeded()
  • 1f9c110: 8301958: Reduce Arrays.copyOf/-Range overheads
  • cb81073: 8300139: [AIX] Use pthreads to avoid JNI_createVM call from primordial thread
  • bbd8ae7: 8294194: [AArch64] Create intrinsics compress and expand
  • 4e327db: 8301499: Replace NULL with nullptr in cpu/zero
  • 0458d38: 6513512: MetalLookAndFeel.initClassDefaults does not install an entry for MetalMenuBarUI
  • ... and 62 more: https://git.openjdk.org/jdk/compare/3db352d003c5996a5f86f0f465adf86326f7e1fe...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 Feb 13, 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 Feb 15, 2023

Thanks @TobiHartmann @vnkozlov for the reviews!
/integrate

@openjdk
Copy link

openjdk bot commented Feb 15, 2023

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

  • 98a392c: 8302102: Disable ASan for SafeFetch and os::print_hex_dump
  • 9ccf8ad: 8302129: Make MetaspaceReclaimPolicy a diagnostic switch
  • bdcbafb: 8296344: Remove dependency on G1 for writing the CDS archive heap
  • f1d76fa: 8302262: Remove -XX:SuppressErrorAt develop option
  • 9c202a5: 8302260: VarHandle.describeConstable() fails to return a nominal descriptor for static public fields
  • ca73f7e: 8301374: NullPointerException in MemberEnter.checkReceiver
  • 5b2d430: 8297632: InputStream.transferTo() method should specify what the return value should be when the number of bytes transfered is larger than Long.MAX_VALUE
  • f7dee77: 8301274: update for deprecated sprintf for security components
  • ec901f2: 8301279: update for deprecated sprintf for management components
  • 8933c2d: 8298278: JFR: Turn MEMFLAGS into a type for use with the NativeMemoryUsage events
  • ... and 89 more: https://git.openjdk.org/jdk/compare/3db352d003c5996a5f86f0f465adf86326f7e1fe...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Feb 15, 2023

@eme64 Pushed as commit a9a53f4.

💡 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
3 participants