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.
Sorry for the late reply - I don't check the newsgroup very often. If you
want a faster reply (and more people to read your post), please use the
mailing lists if you can.
Only static info is supported in if() at the moment so it is a global
control for tracing. The subject of efficient tracing has come up on the
mailing list now and again, try taking a look through the archives: http://dev.eclipse.org/mhonarc/lists/aspectj-users/maillist. html
And be careful with cflow as it isn't cheap - are you absolutely sure you
need it?
Sorry for the late reply - I don't check the newsgroup very often. If you
want a faster reply (and more people to read your post), please use the
mailing lists if you can.
Only static info is supported in if() at the moment so it is a global
control for tracing. The subject of efficient tracing has come up on the
mailing list now and again, try taking a look through the archives: http://dev.eclipse.org/mhonarc/lists/aspectj-users/maillist. html
And be careful with cflow as it isn't cheap - are you absolutely sure you
need it?