-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Avoid duplicate calls to getParameterTypes and getGenericParameterTypes #21794
Conversation
Thanks for your pull request! The title of your pull request does not follow our editorial rules. Could you have a look?
|
Will have to rebase these changes, apperantly more was included in the commit then I originally intended. |
c86f160
to
954c523
Compare
This workflow status is outdated as a new workflow run has been triggered. 🚫 This workflow run has been cancelled. Failing Jobs - Building 67ba867
|
This workflow status is outdated as a new workflow run has been triggered. 🚫 This workflow run has been cancelled. Failing Jobs - Building c86f160
|
954c523
to
28eb2ad
Compare
This is now ready for review. |
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.
Overall, this looks very good. I added a small comment about synchronization in a RESTEasy Reactive class. @geoand would know more for sure.
@@ -102,8 +103,10 @@ public Method getResourceMethod() { | |||
} | |||
|
|||
public Annotation[] getParameterAnnotations(int index) { | |||
// Should we cache this? | |||
return getMethod().getParameterAnnotations()[index]; | |||
if (parameterAnnotations == null) { |
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.
Given how getMethod()
looks in the same class, there's a good chance this might need a synchronization pattern.
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.
Yeah, I'd say let's just skip the change to this method.
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.
@Postremus could you revert this specific change and squash? After that I think it's good to go.
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.
@gsmet I will do a squash & rebase this evening (CEST).
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.
done
Calling getParameterTypes or getGenericParameterTypes creates clones of the underlying arrays. Doing so during iterations is costly, so lets better not do that.
28eb2ad
to
8d08f0a
Compare
Calling getParameterTypes or getGenericParameterTypes creates clones of the underlying arrays.
Doing so during iterations is costly, so lets better not do that.
This again saves saves a few ms. I saw both of these calls at "0,8% of all" according to the flamegraphs.
Related to #21552