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

8324646: Avoid Class.forName in SecureRandom constructor #258

Conversation

olivergillespie
Copy link
Contributor

@olivergillespie olivergillespie commented Feb 13, 2024

Hi all,

This pull request contains a backport of commit 8ef918d6 from the openjdk/jdk repository.

The commit being backported was authored by Oli Gillespie on 9 Feb 2024 and was reviewed by Aleksey Shipilev and Weijun Wang.

Thanks!


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • JDK-8324646 needs maintainer approval

Issue

  • JDK-8324646: Avoid Class.forName in SecureRandom constructor (Enhancement - P4 - Approved)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk21u-dev.git pull/258/head:pull/258
$ git checkout pull/258

Update a local copy of the PR:
$ git checkout pull/258
$ git pull https://git.openjdk.org/jdk21u-dev.git pull/258/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 258

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk21u-dev/pull/258.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 13, 2024

👋 Welcome back ogillespie! 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 changed the title Backport 8ef918d6678437a5b351b172bb4cf144eeaa975f 8324646: Avoid Class.forName in SecureRandom constructor Feb 13, 2024
@openjdk
Copy link

openjdk bot commented Feb 13, 2024

This backport pull request has now been updated with issue from the original commit.

@openjdk
Copy link

openjdk bot commented Feb 13, 2024

⚠️ @olivergillespie This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 13, 2024
@mlbridge
Copy link

mlbridge bot commented Feb 13, 2024

Webrevs

@olivergillespie
Copy link
Contributor Author

/approval request Performance improvement in SecureRandom. which I have seen on the hot path. Clean backport, simple change with low risk in my opinion.

@openjdk
Copy link

openjdk bot commented Feb 13, 2024

@olivergillespie
8324646: The approval request has been created successfully.

@openjdk openjdk bot added the approval label Feb 13, 2024
@GoeLin
Copy link
Member

GoeLin commented Feb 14, 2024

Hi @olivergillespie
As this is an optimization I think it should bake in head for a while. Please label again for the July update, dev starts 27.2..

@openjdk openjdk bot removed the approval label Feb 14, 2024
@olivergillespie
Copy link
Contributor Author

/approval request Performance improvement in SecureRandom, which I have seen on the hot path. Clean backport, simple change with low risk in my opinion (re-requesting now for July update and it has been in tip for a few weeks). Similar to 8324648 which was just approved.

@openjdk
Copy link

openjdk bot commented Mar 4, 2024

@olivergillespie
8324646: The approval request has been updated successfully.

@openjdk openjdk bot added the approval label Mar 4, 2024
@GoeLin
Copy link
Member

GoeLin commented Mar 12, 2024

@olivergillespie, please back port to 22, too, also, there are failing tests. removing the label

@openjdk openjdk bot removed the approval label Mar 12, 2024
@olivergillespie
Copy link
Contributor Author

Thanks, sorry @GoeLin for not understanding the backport procedure properly. I thought approval came first, before final testing/review etc., my mistake!

Backport to 22 (approval requested): openjdk/jdk22u#98

Tests are now passing after merging from master.

Benchmark results (make test TEST=micro:org.openjdk.bench.java.security.SecureRandomBench):

Before: 495 ± 6 ns/op
 After:  103 ± 1.6 ns/op

Hopefully I didn't miss anything this time, so I'll request approval again - thanks.

@olivergillespie
Copy link
Contributor Author

/approval request Performance improvement in SecureRandom.<init>, which I have seen on the hot path. Clean backport, simple change with low risk in my opinion due to small, simple change in only one file (re-requesting now for July update and it has been in tip for a few weeks). Similar to 8324648 which was approved. Update: re-re-requesting after fixing unrelated test failures with merge from master, and added benchmark results (before: 500ns/op, after: 100ns/op).

@openjdk
Copy link

openjdk bot commented Mar 13, 2024

@olivergillespie
8324646: The approval request has been updated successfully.

@openjdk openjdk bot added the approval label Mar 13, 2024
@openjdk
Copy link

openjdk bot commented Mar 13, 2024

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

8324646: Avoid Class.forName in SecureRandom constructor

Reviewed-by: shade

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

  • 9e1840f: 8325613: CTW: Stale method cleanup requires GC after Sweeper removal
  • 2de8cfa: 8327799: JFR view: the "Park Until" field of jdk.ThreadPark is invalid if the parking method is not absolute
  • d1af31b: 8318757: VM_ThreadDump asserts in interleaved ObjectMonitor::deflate_monitor calls
  • cc65d0d: 8325372: Shenandoah: SIGSEGV crash in unnecessary_acquire due to LoadStore split through phi
  • 6d8d049: 8324632: Update Zlib Data Compression Library to Version 1.3.1
  • 5431b82: 8322239: [macos] a11y : java.lang.NullPointerException is thrown when focus is moved on the JTabbedPane
  • 5762df6: 8321489: Update LCMS to 2.16
  • a69c437: 8316559: Refactor some util/Calendar tests to JUnit
  • 390e647: 8313612: Use JUnit in lib-test/jdk tests
  • 539b04e: 8314832: Few runtime/os tests ignore vm flags
  • ... and 12 more: https://git.openjdk.org/jdk21u-dev/compare/c8e9f1d5d375b4594537147df05e28dda3347871...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.

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 (@shipilev) 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 ready Pull request is ready to be integrated and removed approval labels Mar 14, 2024
@olivergillespie
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Mar 19, 2024
@openjdk
Copy link

openjdk bot commented Mar 19, 2024

@olivergillespie
Your change (at version 955b3a0) is now ready to be sponsored by a Committer.

@shipilev
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Mar 19, 2024

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

  • c8ddf40: 8326529: JFR: Test for CompilerCompile events fails due to time out
  • eb4f76e: 8328066: WhiteBoxResizeTest failure on linux-x86: Could not reserve enough space for 2097152KB object heap
  • 196a851: 8223696: java/net/httpclient/MaxStreams.java failed with didn't finish within the time-out
  • 700fd39: 8322920: Some ProcessTools.execute* functions are declared to throw Throwable
  • 6632caa: 8288989: Make tests not depend on the source code
  • 81f621d: 8316696: Remove the testing base classes: IntlTest and CollatorTest
  • dc6afd0: 8312320: Remove javax/rmi/ssl/SSLSocketParametersTest.sh from ProblemList
  • b3e8176: 8309757: com/sun/jdi/ReferrersTest.java fails with virtual test thread factory
  • 06e4cf3: 8315559: Delay TempSymbol cleanup to avoid symbol table churn
  • 9e1840f: 8325613: CTW: Stale method cleanup requires GC after Sweeper removal
  • ... and 21 more: https://git.openjdk.org/jdk21u-dev/compare/c8e9f1d5d375b4594537147df05e28dda3347871...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Mar 19, 2024

@shipilev @olivergillespie Pushed as commit eaa8ed9.

💡 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
backport clean integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants