BurningCN opened a new pull request, #10173:
URL: https://github.com/apache/dubbo/pull/10173

   在注解方式配置模式中,在`ReferenceAnnotationBeanPostProcessor#registerReferenceBean` 
方法中会执行 `ReferenceBeanSupport.generateReferenceKey(attributes, 
applicationContext)` 会生成`referenceKey`并写入`ReferenceManager#referenceKeyMap`缓存中。
   
   后续发生`ReferenceAnnotationBeanPostProcessor#doGetInjectedBean` -> ` 
ReferenceBean#afterPropertiesSet` -> 
`ReferenceManager#addReference`,该方法中又再次调用`generateReferenceKey`方法来构建`referenceKey`(`generateReferenceKey`方法相对耗时),其实可以从缓存直接获取。
   
   并且` ReferenceBeanManager#initReferenceBean` 方法发生在 
`ReferenceBeanManager#addReference`方法后,也可以先尝试从`ReferenceManager#referenceKeyMap`缓存中获取
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to