-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
8265075: Improve and simplify Class.resolveName() #3464
Conversation
👋 Welcome back stsypanov! A progress list of the required criteria for merging this PR into |
@stsypanov The following label will be automatically applied to this pull request:
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. |
Mailing list message from Peter Levart on core-libs-dev: Hi, Sergey! Have you measured the code change in the java.lang.Class itself or just The JMH test may show better results as it is compiled to bytecode that Regards, Peter On 4/13/21 2:55 PM, ?????? ??????? wrote: |
@plevart you are right, when the method is called from |
We can remove the check for baseName being null, that's a left over from iteration during JDK 9. |
@AlanBateman should I then do it only for |
If you have the time, then looking for usages of getPackageName where it checks for null would be useful. We can close this PR and open a new issue/PR for that cleanup. |
Ok, then I close this one |
In mentioned method this code snippet
can be simplified with performance improvement as
Also null check of
baseName
can be removed as Class.getPackageName() never returns null.This benchmark
demonstrates good improvement, especially as of memory consumption:
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3464/head:pull/3464
$ git checkout pull/3464
Update a local copy of the PR:
$ git checkout pull/3464
$ git pull https://git.openjdk.java.net/jdk pull/3464/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3464
View PR using the GUI difftool:
$ git pr show -t 3464
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3464.diff