Store annotation getters of ClassInfo and MethodInfo#878
Store annotation getters of ClassInfo and MethodInfo#878lukehutch merged 1 commit intoclassgraph:latestfrom
Conversation
|
@freya022 Thanks for the contribution! I didn't realize these same methods would be called repeatedly on the same classes, so I never cached them. Are you duplicating work in your code? There are probably some other method calls that could be memoized in this way too, but I don't have the time to review/audit the API surface right now. The downside of this is of course greater memory overhead while the |
|
Yes, there are multiple places where i need to check for the annotations, a workaround would be to create my own objects which store the CG object and a few other properties I often need, having the annotations stored on the CG object is cleaner and performant enough |
|
Released in 4.8.175. Thanks! |
As those are the most likely used, this could save considerable CPU time
In my workload these changes produce a 2x improvement (~167ms -> ~84ms), as I run over some classes multiple times