Joerg Heinicke pisze:
If so performance loss would at the most two times slower.

What does this mean? This sentence makes no sense to me ;)

It was late here when writing this sentence. I meant:
if T is time needed for particular pipeline to execute without ScopeChanger, just ouf of reading ScopeChanger's code we can see that if it's enabled new execution time is restricted by < 2*T.

If you take into account components that actually do something the
performance loss could be less noticeable I think.

It's about complexity calculations [1].

Joerg, remember that I'm math student so you can be sure that I'm really familiar with complexity calculations. ;-)

We used to even proof that certain algorithm belongs certain complexity class or even that problem is solvable only in certain (or higher) complexity class... :-)

Your approach is of O(m*n) with m = number of SAX events and n = number of components. The environment change has to be executed m*n times. With my approach it was only O(1*n). Ignore the number of components it's O(m) vs. O(1) - and number of SAX events can be huge. That's why it is not lightweight.

But you must remember about the fact that each SAX event is already processed (usually just forwarded) so whole pipeline's complexity is already O(nm). ScopeChanger adds only constant factor to n*m so complexity class does not change, really.

Auto-proxying only starts in chapter 7.9 [2] :)

Thanks for a link, I'll at it.

You can probably just move the code of ScopeChangerProxy straight to a subclass of AbstractAdvisorAutoProxyCreator (which would be coupled to Spring as a BeanPostProcessor is, actually it is a BeanPostProcessor as well but does the proxying for you) or to a MethodInterceptor.

What's the best choice?


I see. The best lightweight approach is useless if it does not meet the requirements ;) Let me thnk about it ...

Joerg, if you find solution dramatically different (and better when it comes to performance) from ScopeChanger I'll be happy to stand you a beer as soon as there is an occasion... ;-)

--
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/
*** My Internet Service Provider breaks my internet connection                
***
*** incessantly so I'll not be able to respond to e-mails                     
***
*** regularly and my work will be somehow irregular.                          
***
*** I'm already trying to switch ISP but it will take handful amount of time. 
***

Reply via email to