Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Is there any performance issue using thisJoinPoint

You can raise an enhancement request where we can discuss it -
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=AspectJ - I might
need to see a more fleshed out example to fully understand it, but I
have only glanced over it.

> I'm not sure about the
> possibility to use if(). The aspects will be per-type and the decision data
> will be associated with the aspect instance.

Although you are using per-type, depending on your situation there may
still be value in a global flag.  The flag can be false if all types
have logging turned off.  Once one of them turns it on you flip the
flag.  Yes that means all types (even those not yet logging) won't
benefit from the if test once one of them is logging, but in the case
when no-one is logging it will avoid tjp construction for all of them.

> Is there any possiblity to delay the reflection.

It isn't reflection that is used to build the tjp - it is simply a
collection of the state around at the joinpoint: this, target, the
arguments on the stack, etc.  If the state isn't collected up
precisely at the point it is about to be used, it may be difficult to
discover later.

cheers
Andy

On 23 December 2010 02:13, Marko Umek <marko.umek@xxxxxxxxxxxxx> wrote:
>
> Hi Andy,
>
> thx for answer. I found it also in AspectJ in Action book.
>
> Is there any possiblity to delay the reflection. I'm not shure about the
> possibility to use if(). The aspects will be per-type and the decision data
> will be associated with the aspect instance.
>
> So another question: Is it impossible to add a new feature someting like
> thisLazyJoinPoint which uses the a closure functionality to delay the
> creation of the actually (dynamic) join point.
>
> Suggestion/Feature request:
>
> Object arount() : pc() {
>    if( .... ) {
>      JointPoint jp=thisLazyJoinPoint.bind();
>    }
> }
>
> ---
> public interface LazyJoinPoint {
>      JoinPoint bind();
> }
> ---
>
> // the generated code code could be look like this.
> final Object __this=this;
> final Object __target=...;
> // other objects which are necessary for creating thisJoinPoint. But only
> referencing ;-)
> final LazyJoinPoint __lazyJoinPoint = new LazyJoinPoint() {
>    public JoinPoint bind() {
>         JoinPoint jp=...;
>         // do the reflection stuff with __this and __target
>        ...
>         return jp;
>    }
> }
>
> // calling the advice.
>
>
> This would be an awful cool feature. I know this would create a lot of
> additional classes, but in Groovy Closures are an ubiquitous used feature
> and nobody complaining about to much classes.
>
> So you could add this as a feature request if this is possible.
>
> Thx and merry xmas :-)
>
> Marko
> --
> View this message in context: http://aspectj.2085585.n4.nabble.com/Is-there-any-performance-issue-using-thisJoinPoint-tp3160915p3161860.html
> Sent from the AspectJ - users mailing list archive at Nabble.com.
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top