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

Reduce the occurrence of reflection for many known cases #194

Merged
merged 1 commit into from
Oct 15, 2019

Conversation

MikeEdgar
Copy link
Member

Relates to #191 and also the fix for quarkusio/quarkus#2961.

The idea with these changes is to mostly eliminate the fallback to reflection during the "is a" tests used by class/annotation scanning by including a small internal index of JDK classes most commonly used. Ideally, this would eliminate the need for any downstream work-around like in the fix for quarkus 2961.

Copy link
Contributor

@kenfinnigan kenfinnigan left a comment

Choose a reason for hiding this comment

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

Looks ok from my perspective. @EricWittmann or @msavy any thoughts?

@MikeEdgar does this work ok with Quarkus master?

@MikeEdgar
Copy link
Member Author

@kenfinnigan , I tested this with the repo referenced in quarkusio/quarkus#2961 using Hibernate+Panache and Quarkus 0.24.0. I can run some additional tests with master as well.

@msavy msavy self-requested a review October 15, 2019 13:13
Copy link
Contributor

@msavy msavy left a comment

Choose a reason for hiding this comment

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

This seems reasonable to me. I experimented with some similar techniques early on with my prototypes, but decided not to pursue it at the time (favouring runtime with the thought that this would reduce unnecessary indexing).

However, given the Quarkus model, this approach now likely makes more sense than before.

@MikeEdgar
Copy link
Member Author

However, given the Quarkus model, this approach now likely makes more sense than before.

Thanks @msavy for the feedback. I think going down this path will allow the annotation scanner to further skip introspection of some of the JDK packages to prevent unexpected results like seen in #193.

@kenfinnigan kenfinnigan merged commit 4fb7621 into smallrye:master Oct 15, 2019
@MikeEdgar MikeEdgar deleted the reduce_reflection branch October 16, 2019 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants