Runtime/Dynamic pointcuts [message #71872] |
Wed, 25 June 2008 13:14 |
Eclipse User |
|
|
|
Originally posted by: Paul.Carroll.ericsson.com
We've noticed a performance drop in one of our applications when using
code woven with aspects (using aspectj 1.5 or 1.6) and resolved it down to
the cflow point cut.
We need the trace generated so can't really remove cuts but one thing I
was looking to do was see if there is a way for a pointcut to make a java
call instead i.e. if trace is off then there's no point in running any of
the other point cuts i.e.
Before :
pointcut publicMethods (execution (public * com.ab.b.d.*.*(..));
before() : cflowbelow(publicMethods()) {
// Do some tracing....
}
after() returning : cflowbelow(publicMethods()) {
// Do some trace.....
}
After
pointcut publicMethods (execution (public * com.ab.b.d.*.*(..));
pointcut isTracingOn (.........);
before() : isTracingOn(...) && cflowbelow(publicMethods()) {
// Do some tracing....
}
The end result would be that isTracingOn() would resolve to false and
other pointcuts are not checked/executed thus cflowbelow doesn't run....
OR is there a way to dynamically turn off aspects in woven code i.e. they
never get evaluated, so there should be zero performance difference
between running unwoven code and code woven but the aspects turned off.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04186 seconds