[jboss-dev-forums] [Design of AOP on JBoss (Aspects/JBoss)] - Optimizing genrated advisors

kabir.khan@jboss.com do-not-reply at jboss.com
Fri Mar 23 07:39:05 EDT 2007


I've started a stress test framework, which lives under src/test/org/jboss/test/aop/stress. I'll be fleshing it out over the next few weeks and posting my findings here. To run the org.jboss.test.aop.stress.perinstancemethodinvocation test for example


  | $ build.sh -f build-tests-jdk50.xml main loadtime-ga-test loadtime-test -Dtest=stress/perinstancemethodinvocation
  | 

The good news
=============

1) For method interception etc. using per_vm interceptors in generated advisors seem a bit faster than classic despite the extra method call in the weaving model. 

2) For method interception etc. using per_vm aspects generated advisors seem about 10% faster than classic, probably because now the generated joinpoint classes call the advice method directly rather than relying on a generated class

3) Executing this 100000 times initially caused an OutOfMemoryError

  |    <interceptor name="Int1" class="org.jboss.test.aop.stress.perinstancemethodinvocation.PerInstanceInterceptor" scope="PER_INSTANCE"/>
  | 
  |    <bind pointcut="execution(* org.jboss.test.aop.stress.perinstancemethodinvocation.POJO->method1())">
  |       <interceptor-ref name="Int1"/>
  |    </bind>
  | 
  | 
  |       public void execute(int thread, int loop) throws Exception
  |       {
  |          POJO pojo = new POJO();
  |          pojo.method1();
  |       }
  | 
I have fixed the leak, so this problem does not occur anymore

The bad news
============
* Executing the per_instance example from above with generated advisors  takes about 21 times as long as using classic. This is probably because for each new object, (Just working off memory here) if an object has per_instance aspects we then need to obtain a per_instance domain, populate the domain, redo all the bindings, and generate a unique joinpoint class for every single object. So I think we need to differentiate between cases where we actually have overridden something in the instance domain (i.e. dynamic aop) and where we are basically just inheriting everything from the parent.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031020#4031020

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4031020



More information about the jboss-dev-forums mailing list