-
Notifications
You must be signed in to change notification settings - Fork 19
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
spring+aop场景下性能很低 #67
Comments
aop的切面是什么呢 |
是一个日志的切面,我试验后发现跟切面没啥关系。主要是@lazy的问题。 |
等我空的时候看下, 如果是因为这个原因就换一下实现,这个好解决 |
可以更新 1.4.0-R1 版本,试一下 |
This issue is stale because it has been open for 30 days with no activity. |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
线上压测发现QPS很低 发现瓶颈出现在了mapstruct-plus上。
![image](https://private-user-images.githubusercontent.com/76103126/309140143-59fbfc30-1b60-40de-b194-479eb7e33206.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMwNzQ5MTcsIm5iZiI6MTcyMzA3NDYxNywicGF0aCI6Ii83NjEwMzEyNi8zMDkxNDAxNDMtNTlmYmZjMzAtMWI2MC00MGRlLWIxOTQtNDc5ZWI3ZTMzMjA2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA3VDIzNTAxN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRkMWJhNmZmZWE5MzVlMjU1MjIzNDU0MDUxOTQ1MWExNmM0NDU5ODU4YzRhMTZmNTE5YTAwM2QyZDVjZWRmMmQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.5b62JioQBbr2ISmbeqVtnOxhu1-Ekt6Jk9_BqiCFDq4)
在调用集合转换时 spring会每次去容器中搜索实现类
调用堆栈大概是这样的。
怀疑是动态代理+@lazy时 spring每次取实现类的时候要到整个容器中进行搜索。
每次都会走JdkDynamicAopProxy的invoke方法,然后调用 target = targetSource.getTarget();
我觉得问题在于ContextAnnotationAutowireCandidateResolver在buildLazyResolutionProxy方法中提供的TargetSource没有缓存,每次都会去整个Spring容器中搜索。
是否有办法规避这个问题?
The text was updated successfully, but these errors were encountered: