|
From: Rod J. <rod...@in...> - 2003-11-28 12:47:14
|
All, I've been doing a lot of performance work lately, and I'm sure you'll be happy with the results. I've made two significant changes: - AopProxy now optimizes out empty advice chains, invoking the target directly if there's a local target invoked by reflection. This optimization doesn't apply if AdvisedSupport is configured to expose proxy or invocation, which supposedly advised code may depend on. Performance benefit for invoking non-advised methods on an advised object is about 30%. (Assuming the method does not work itself, of course.) - TransactionProxyFactoryBean now creates an InterceptionAroundAdvisor with a pointcut that includes only transaction methods, rather than always adding TransactionInterceptor. So TransactionInterceptor only runs if there _is_ a transaction. Thus advice chain caching in the AOP framework can do its work. Performance improvement around 50% in invoking non-advised methods on a transaction proxy (no change in transactional methods, obviously.) I've changed the TransactionAttributeSource to take Method and Class not MethodInvocation, to make this work. It's an improvement anyway. Also: - Various logging guards which produce a slight boost in performance of Spring transaction management. Note that I've refactored MethodInvocationFactory into two: MethodInvocationFactory and AdviceChainFactory. This was necessary to allow the AOP optimization, but is an improvement I was planning anyway. This would make something like a Commons Pooling approach to MethodInvocations easy to implement. (However I would be surprised if there's much gain from doing that as such short-lived objects never get out of eden.) Now it would be nice if it were possible to get a CGLIB proxy that didn't override the methods with no advice. Is this possible? I'll look in the docs. Regards, Rod ____________________________________________________ Rod Johnson J2EE Consultant and Author +44 7973 409 132 rod...@in... Author of "Expert One-on-One J2EE Design and Development" (October 2002). http://www.amazon.com/exec/obidos/tg/detail/-/0764543857/ Founder, Spring Framework: http://www.springframework.org "Introducing the Spring Framework" (ServerSide article) http://www.theserverside.com/resources/article.jsp?l=SpringFramework |