Skip to content

Variable-hides-field hint optimization #8525

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mbien
Copy link
Member

@mbien mbien commented May 23, 2025

compilationinfo.getElements() in inner loop prevented the JVM from inlining calls into the loop body. Moving it out of the loop improves hint performance by 10x in files with many fields.

rest is cleanup

@mbien mbien added this to the NB27 milestone May 23, 2025
@mbien mbien requested a review from lahodaj May 23, 2025 02:29
@mbien mbien added Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) performance hints labels May 23, 2025
Comment on lines +91 to +96
Elements elements = compilationInfo.getElements();
for (Element field : getAllMembers(compilationInfo, te)) {
if (stop) {
return null;
}
if (compilationInfo.getElements().hides(el, field)) {
if (elements.hides(el, field)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

that is the change

@mbien
Copy link
Member Author

mbien commented Jun 17, 2025

planning to merge this one soon since its one of the smaller ones

compilationinfo.getElements() in inner loop prevented the JVM from
inlining calls into the loop body. Moving it out of the loop improves
performance by 10x in files with many fields.

rest is cleanup
@mbien mbien force-pushed the faster-hides-field-hint branch from 1e012d6 to 23deda2 Compare June 17, 2025 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code cleanup hints Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant