Skip to content

Java: Improve join-order for FunctionalInterface. #13404

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

Merged
merged 1 commit into from
Jun 8, 2023

Conversation

aschackmull
Copy link
Contributor

Reimplements #13357

As reported by @rvermeulen, for very large code bases the current join order (find all interface abstract methods, join with all overrides of those methods, check if the interface also inherits a concrete override) can blow up

@aschackmull aschackmull added the no-change-note-required This PR does not need a change note label Jun 8, 2023
@aschackmull aschackmull requested a review from a team as a code owner June 8, 2023 11:05
@github-actions github-actions bot added the Java label Jun 8, 2023
Copy link
Contributor

@smowton smowton left a comment

Choose a reason for hiding this comment

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

lgtm if you've confirmed this results in the desired join order (first join with concrete (default) methods this interface inherits, then match against the candidate abstract method)

@aschackmull
Copy link
Contributor Author

lgtm if you've confirmed this results in the desired join order (first join with concrete (default) methods this interface inherits, then match against the candidate abstract method)

I have. Also, that's exactly what bindingset[m] pragma[inline_late] ensures.

@aschackmull
Copy link
Contributor Author

I've additionally added a piece of manual magic in the form of "overrides something" m.overrides(_) as that improves things quite a bit further.

@aschackmull aschackmull merged commit 65a68f5 into github:main Jun 8, 2023
@aschackmull aschackmull deleted the java/functionalinterface-perf branch June 8, 2023 13:00
@smowton
Copy link
Contributor

smowton commented Jun 8, 2023

Sounds good -- I have no intuition as to what late inlining is going to do!

@aschackmull
Copy link
Contributor Author

I have no intuition as to what late inlining is going to do!

Late inlining means "join-order first, then inline". It works in conjunction with the bindingset, such that the bindingset provides join-order restrictions. In this case m is required to be bound before the predicate can be chosen, so something that binds m must be join-ordered before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants