-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8323183: ClassFile API performance improvements #17306
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
Conversation
…e Classfile API to generate proxy classes
…ounter.java Co-authored-by: ExE Boss <[email protected]>
This reverts commit 75e31e3.
This reverts commit a21fb26.
This reverts commit 3080d24.
…o use the Classfile API to generate proxy classes" This reverts commit 0267d65.
|
👋 Welcome back asotona! A progress list of the required criteria for merging this PR into |
Webrevs
|
src/java.base/share/classes/jdk/internal/classfile/impl/StackCounter.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/jdk/internal/classfile/impl/StackCounter.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/jdk/internal/classfile/impl/StackCounter.java
Outdated
Show resolved
Hide resolved
|
You need to update the slot counting from |
It would be good to avoid all bottlenecks, however not all of them have equal effect. |
src/java.base/share/classes/jdk/internal/classfile/impl/StackCounter.java
Outdated
Show resolved
Hide resolved
…ounter.java Co-authored-by: liach <[email protected]>
|
StackMapGenerator benchmark is heavily benefiting from symbols caching for repeated execution. Based on these results I've decided to revert custom parameter slots counting method and apply the previously proposed solution by @liach . |
src/java.base/share/classes/jdk/internal/classfile/impl/StackMapDecoder.java
Outdated
Show resolved
Hide resolved
…apDecoder.java Co-authored-by: Andrey Turbanov <[email protected]>
|
@asotona This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
|
Please review. Thank you! |
cl4es
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improvement looks good, but the microbenchmark needs to sink new instances into a blackhole to make sure we measure the right thing.
| import java.lang.classfile.constantpool.DynamicConstantPoolEntry; | ||
| import java.lang.classfile.constantpool.MemberRefEntry; | ||
| import static java.lang.classfile.ClassFile.*; | ||
| import java.lang.constant.MethodTypeDesc; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imports are strangely out-of-order and imports in the classfile package look haphazard. Is there some system to it that I don't see? I don't know if we have an applicable style guide to lean on, but alphabetically sorted and static imports split out at the end seem like the convention in the OpenJDK sources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks.
| this.methodDesc = methodDesc; | ||
| this.cp = cp; | ||
| map = new LinkedHashMap<>(); | ||
| targets = new ArrayDeque<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing ArrayDeque being put to good use always makes me happy.
| public void benchmarkStackMapsGenerator() { | ||
| for (var d : data) new StackMapGenerator( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we return something from a benchmark JMH makes sure to sink that something into a blackhole to avoid JIT assuming the result is unused and eliminating it, wholly or in parts. When it's impractical to return a single thing that captures all the computation in the benchmark it's good practice to let a org.openjdk.jmh.infra.Blackhole consume effects to attain the same effect:
public void benchmarkStackMapsGenerator(Blackhole bh) {
for (var d : data) bh.consume(new StackMapGenerator(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks.
|
@asotona 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: 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 no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
|
/integrate |
ClassFile API performance related improvements have been separated from #17121 into this PR.
These improvements are important to minimize performance regression of
8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes #17121
Please review.
Thanks,
Adam
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/17306/head:pull/17306$ git checkout pull/17306Update a local copy of the PR:
$ git checkout pull/17306$ git pull https://git.openjdk.org/jdk.git pull/17306/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 17306View PR using the GUI difftool:
$ git pr show -t 17306Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/17306.diff
Webrev
Link to Webrev Comment