Not quite sure why we aren't able to see comparable numbers...

Those first numbers of mine where on the Mac, now on windows.
AspectJ1.6.0 and Sun java 1.5.

> ajc -1.5 -showWeaveInfo *.java
Join point 'field-set(int SuperCar.model)' in Type 'SuperCar'
(SuperCar.java:2) advised by
around advice from 'SuperObjectController ' (SuperObjectController.java:9)

Join point 'field-get(int SuperCar.model)' in Type 'SuperCar'
(SuperCar.java:5) advised by
around advice from 'SuperObjectController ' (SuperObjectController.java:4)

Join point 'field-set(int SuperCar.model)' in Type 'SuperCar'
(SuperCar.java:9) advised by
around advice from 'SuperObjectController' (SuperObjectController.java:9)

> javap -verbose SuperCar

public int getModel();
  Code:
   Stack=5, Locals=2, Args_size=1
   0:   aload_0
   1:   astore_1
   2:   aload_0
   3:   aload_1
   4:   invokestatic    #39; //Method
SuperObjectController.aspectOf:()LSuperObjectController;
   7:   aload_0
   8:   aconst_null
   9:   invokestatic    #65; //Method
model_aroundBody3$advice:(LSuperCar;LSuperCar;LSuperObjectController;LSuperObject;Lorg/aspectj
/runtime/internal/AroundClosure;)Ljava/lang/Object;
   12:  invokestatic    #53; //Method
org/aspectj/runtime/internal/Conversions.intValue:(Ljava/lang/Object;)I
   15:  ireturn

See the unwanted conversion at offset12 (because your advice returned
an Object but the field was an int).  Similar story for setModel().

New aspect, compile the same way

>  javap -verbose SuperCar
public int getModel();
  Code:
   Stack=5, Locals=2, Args_size=1
   0:   aload_0
   1:   astore_1
   2:   aload_0
   3:   aload_1
   4:   invokestatic    #39; //Method
SuperObjectController.aspectOf:()LSuperObjectController;
   7:   aload_0
   8:   aconst_null
   9:   invokestatic    #55; //Method
model_aroundBody3$advice:(LSuperCar;LSuperCar;LSuperObjectController;LSuperObject;Lorg/aspectj
/runtime/internal/AroundClosure;)I
   12:  ireturn

Cast is gone, same in setModel()

As I mentioned in my first reply, the generated code (1) obtains the
aspect instance (2) calls the advice in the aspect

Old aspect (1000000 calls)
Super:202
Normal:16
Super:101
Normal:46
Super:89
Normal:28

New aspect:
Super:86
Normal:47
Super:55
Normal:46
Super:33
Normal:17

Perhaps I'm overlooking something that should become apparent now i've
told you everything - let me know if i'm doing something wrong.

cheers,
Andy.

2008/5/9 nnaass <[EMAIL PROTECTED]>:
>
> Hey Eric ,
> Thanks for the advice, but do you know an easy way to to switch the compiler
> to abc ?
>
> Thanks
>
> Eric Bodden-2 wrote:
>>
>> Hello.
>>
>>> I need a high performance AOP. I guess I need to look at the javassist to
>>> because I could add the pointcut with only 50% performance loss.
>>
>> Maybe you should first check out abc
>> (http://abc.comlab.ox.ac.uk/introduction) if you have not yet done so.
>> I know that the abc developers spent a lot of time making sure that at
>> least such trivial cases are very well optimized.
>>
>> Eric
>>
>> --
>> Eric Bodden
>> Sable Research Group
>> McGill University, Montréal, Canada
>> _______________________________________________
>> aspectj-users mailing list
>> [email protected]
>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Very-Slow-Fields-Cut-tp17139141p17158968.html
> Sent from the AspectJ - users mailing list archive at Nabble.com.
>
> _______________________________________________
> aspectj-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to