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

kabir.khan@jboss.com do-not-reply at jboss.com
Thu Apr 19 17:16:49 EDT 2007


Quite a lot of progress has been made on improving the instantiation times for objects advised by per_instance aspects when using generated advisors. For generated advisors the instance advisor has a per_instance domain, which is populated similarly to the class advisors domain. Main changes for better performance are:

* Make a lot of the maps in AspectManager/Domain only initialise when first accessed. Quite often these are not used, and TLongObjectHashMap and ConcurrentReaderHashMap are very costly to create.
* Make a lot of the maps in Advisor/ClassAdvisor/GeneratedClassAdvisor also only initialise when first accessed for the same reasons as above.
* Clone the JoinPointInfos from the class advisor
* When creating interceptor chains, simply copy/clone the chains from the class advisor if the instance domain contains no bindings/metadata/etc that would cause the instance advisor to have different chains.
* One JoinPointGenerator is maintained per advised joinpoint at class advisor level. There was no need to duplicate these at instance advisor level since the only difference is what is contained in the now passed in JoinPointInfo
* It is not necessary to build instance advisor chains for constructor and construction joinpoints, as the instance already exists
* Field and method tables can be copied from the class advisor, they will be no different in the instance advisor
* There is no need to generate a unique generated invocation class for every instance, if a class has already been generated for an info with the same chains for the same joinpoint 

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

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



More information about the jboss-dev-forums mailing list