-
Notifications
You must be signed in to change notification settings - Fork 277
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 calling superclass matcher where possible #1248
Avoid calling superclass matcher where possible #1248
Conversation
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.
I don't think this is a safe change.
.and( | ||
safeExtendsClass( | ||
named("com.netflix.hystrix.HystrixCommand") | ||
.or(named("com.netflix.hystrix.HystrixObservableCommand")))); |
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.
I think some of these are safe, but many aren't. For example, HystrixCommand
is intended to be extended, so most usages of this won't match the package prefix. I'm guessing many of these others have a similar issue.
@@ -31,7 +32,9 @@ | |||
|
|||
@Override | |||
public ElementMatcher<TypeDescription> typeMatcher() { | |||
return not(isInterface()).and(safeHasInterface(named("org.hibernate.Criteria"))); | |||
return nameStartsWith("org.hibernate.") |
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.
I don't think this one can be done. I've seen custom Criteria
classes before
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.
reverged whole hibernate and a few others
ef575a7
to
91a56b3
Compare
Saves about 100ms of startup time on test app
91a56b3
to
b6d374e
Compare
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.
This seems more reasonable. Thanks for revisiting.
The change seems like a nice improvement overall, but I'm wondering if we need to adjust our level of abstraction at some point -- not for this PR. Specifically, I'm wondering if we should have a method on the Instrumenter that describes whether to search just a subset of packages. I also think we could stand to create some helper methods for common idioms like... |
Saves about 300ms of startup time on test app