Avoid repeated factory class introspection in AbstractAutowireCapableBeanFactory [SPR-17071] #21609
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Andy Clement opened SPR-17071 and commented
This is a follow on from a comment I made in #21608. I happened to notice a lot of repeated calls to
ReflectionUtils.getUniqueDeclaredMethods()
fromAbstractAutowireCapableBeanFactory.getTypeForFactoryMethod()
. On startup of petclinic I recorded how many times it asked for the same set of unique methods from the same type:(There are more, I just trimmed it there...). I tried a couple of things, caching or adding a
getFilteredUniqueDeclaredMethods()
and passing in the condition from the immediately followingfor(...)
loop. The caching seemed to make ~130ms difference in my fatjar startup benchmark times (from 3.88 > 3.75) but also no doubt helped with reducing a bunch of object allocation. Worth changing?Affects: 5.1 RC1
Issue Links:
Referenced from: commits f58854f
The text was updated successfully, but these errors were encountered: