-
Notifications
You must be signed in to change notification settings - Fork 226
AdvisingBeanPostProcessor can call excessively AopUtils.canApply which can lead to performance issue when using Spring prototypes #185
Comments
Oh interesting, I didn't realize it hit prototype scoped beans so hard. My only concern is the memory usage of that cache. If only Java had a builtin LFU cache. I've pushed a possible fix: https://github.com/ryantenney/metrics-spring/tree/can-apply-cache. Would you be able to test it and see if there's an improvement? |
I should be able to test soon if this resolved our issue. |
We performed a stress test yesterday with your proposed fix an the issue is definitly gone. |
Thanks so much! |
Hi @ryantenney , Thanks! |
Hi @ryantenney , |
Hi @ryantenney , any update on this? Thanks! |
@efasel I'm sorry I haven't gotten this fix out! I'll cut a release this week. |
Hi @ryantenney ! :-) Two month ago you wrote:
Obviously something has come up, but maybe you'll have time soon? Would be great to have a release including this important fix. Thanks! Best regards, |
That was 2 months ago? I'm sorry for keeping you waiting. My personal laptop died and took with it the key I need to sign the release. I'll find a backup and get a release out soon. |
Hi @ryantenney, sorry to hear that your laptop died. I hope you didn't lose anything important. |
Hi @ryantenney, what about a nice Christmas present for the community and have a v3.1.4 release? 🎄 🎁 ? 😃 Best regards, Elmar |
I just got my laptop back from Apple yesterday ;) coming right up |
🎉 |
Hi @ryantenney ! I just saw that you created a tag for v3.1.4 but this was not released to the usual maven repositories. So – as far as I know – we cannot simply update our dependency:
Are you planning on pushing v3.1.4 as an official release? |
Hi @ryantenney! How are you today? Just wanted to ask regarding the 3.1.4 release … :-) |
Our application heavily rely on the following pattern:
each time we instantiate the Prototype object, the AdvisingBeanPostProcessor is getting called and eventually test wheter we can apply AOP on that prototype class using AopUtils.canApply(pointcut, targetClass)
The implementation of AopUtils.canApply is really heavy weight, it has to drill down in each available methods of the target class which can then lead to performance issue.
I do not know if there would be any ways to optimize the pattern? My initial thought is just to create a Map to store wheter if for a given pointcut + targetClass if the check has already been done.
WDYT?
Finally, if you think this is the only way, I can provide a pull request with a potential fix.
Thanks,
The text was updated successfully, but these errors were encountered: