[jboss-dev-forums] [Design of AOP on JBoss (Aspects/JBoss)] - Per Instance Aspects Overhead
flavia.rainone@jboss.com
do-not-reply at jboss.com
Fri Apr 18 01:53:50 EDT 2008
Regarding the JBoss Messaging clustering tests (see previous discussion here http://www.jboss.com/index.html?module=bb&op=viewtopic&t=133377), I have found out what is causing all the overhead.
Since there are per instance aspects involved, InstanceAdvisors get created during the first time the intercepted methods get executed. This happens on the getAround1() method of the generated JoinPoint class, which creates the aspect instance to perform interception.
However, once the class advisor is replaced by an instance advisor, a request for a new JoinPoint class is made to the JoinPointGenerator (this is done by the wrapper created by GeneratedAdvisorMethodExecutionTransformer).
Notice that there are no dynamic AOP actions involved, which means that we would be fine if we used the previously generated joinpoint class.
However, this is not what is happening. Since the JoinPointGenerator used by the InstanceAdvisor is different from the JoinPointGenerator previous used to generate the initial JoinPoint class, there won't be any generated class in the JoinPointGenerator cache, which triggers a joinpoint class generation for each instance of the intercepted class. This explains the amazing amount of class generations we were seeing.
I am going to share the JoinpointGenerator among the instance advisors, and I am going to share it betwen those advisors and class advisor as well. That will avoid creation of extra JoinPoint classes, which should diiminish the overhead.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4145042#4145042
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4145042
More information about the jboss-dev-forums
mailing list