Performance improvement in annotation lookup - #848
Conversation
testn
commented
Nov 1, 2015
- Annotation performs deep equals and hashCode. Wrapping it with AnnotationWrapper to use System.identityHashCode and == makes it significantly faster especially tests with a large number of data providers like the issues in Severe thread contention while running large test with parallel methods #772
- Add NULL_MARKER to mark when a method does not have the annotation. It will save the lookup in such case.
|
Do you have any tests or benchmarks to share? |
|
I ran a cutdown version of #772 by changing it to 6,000 data providers. It seems to reduce the test time by 6 seconds. |
|
If the test only takes 6sec, I think you can add it :) |
|
Well... what it cuts down is the time it takes to initialize the tests which take much more than the test time itself! |
|
Ok, but you can share it even if it won't be run in the suite each time. |
|
That's fine. It does not change the behavior. This is just to improve the caching behavior in JDK15AnnotationFinder without changing anything else. |
|
Closing this PR as obsolete.
Thanks for the original investigation and proposal. |