使用aop的性能影响 [英] Performance impact of using aop

查看:307
本文介绍了使用aop的性能影响的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经开始将spring aop用于我们应用程序的各个方面(目前是安全和缓存).

We have started to use spring aop for cross cutting aspects of our application (security & caching at the moment).

我的经理虽然十分了解这种技术的好处,但仍担心该技术对性能的影响.

My manager worries about the performance impact of this technology although he fully understands the benefits.

我的问题,您是否遇到过使用aop(特别是spring aop)引入的性能问题?

My question, did you encounter performance problems introduced by the use of aop (specifically spring aop)?

推荐答案

只要您能够控制自己的AOP ,我认为这是有效的.无论如何,我们确实确实存在性能问题,所以根据我们自己的推理,我们并没有完全控制自己;)这主要是因为重要的是,撰写方面的任何人都必须对所有 other 完全理解>系统中的各个方面以及它们之间的相互关系.如果您开始做聪明"的事情,您可能会变得聪明起来.在一个只有很多人只看到系统很小部分的大型项目中做聪明的事情,对性能而言是非常危险的.此建议也可能在没有AOP的情况下也适用,但是AOP可以让您以一些真正优雅的方式在脚上射击.

As long as you have control of your AOP I think it's efficient. We did have performance problems anyway, so by own reasoning we were not fully in control ;) This was mostly because it's important that anyone that writes aspects has full understanding of all the other aspects in the system and how they interrelate. If you start doing "smart" things you can outsmart yourself in a jiffy. Doing smart things in a large project with lots of people who only see small parts of the system can be very dangerous performance-wise. This advice probably applies without AOP too, but AOP lets you shoot yourself in the foot in some real elegant ways.

Spring还对范围操作使用代理,并且很容易导致不必要的性能损失.

Spring also uses proxying for scope-manipluations and thats an area where it's easy to get undesired performance losses.

但是,只要您有控制权,AOP唯一真正的痛点就是调试的影响.

But given that you have control, the only real pain point with AOP is the effect on debugging.

这篇关于使用aop的性能影响的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆