Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Aspect Build takes ages to build | AJD 1.7 (Eclipse 4, 2) Build

Abhishek wrote:

 Aspect build is taking ages to complete.

I read it quickly but I don’t think you mentioned whether it is the full build or the incremental build that is taking a long time.  For the kinds of reasons that Alexander mentions, the full build can take longer than a traditional build, but typically that build isn’t done very often. (It is, however, done as the first build each time you start eclipse, unlike the traditional java build that persists build state across restarts).

Incremental builds after that first build should be very quick *unless* you change something that causes the crosscutting to be stale across all the files. Examples:
- you change whitespace in a java source file. We just need to compile that java source file. quick.
- you change the body of a method. We just need to compile that java source file. quick.
- you change the signature of a method/field or add a new method/field. We need to recompile that source file and anyone that depends on it. quick.
- you change the body of a before advice, we *probably* just need to compile the aspect. probably quick.
- you change a pointcut. We (to keep our lives easy since it is an uncommon occurrence) recompile everything. slow.

The important ones are the first 3, those three cases should be fast (and I mean ideally less than 1 second). Now the analysis to work out what kind of build you can do is complicated, and probably not bug free. So if you believe you are working on the code and hitting those 3 cases, but still having sucky build times - we need to understand why. That is where the AJDT event trace view comes into play since if you look at the entries that appear in it after you press ‘save’ on your file, it goes into detail on why we ended up doing the kind of build we did.

Yes, turning on all the categories in the event trace view will probably slow things down. That’s why the view isn’t shown by default.

An aspect build also needs more heap, typically, so bumping Xmx can be necessary. If you compile isn’t quite running out of heap but is thrashing in GC it will be slow.

cheers,
Andy

On Jan 6, 2015, at 3:18 AM, Alexander Kriegisch <Alexander@xxxxxxxxxxxxxx> wrote:

Hi Abishek.

If you remember the term "cross-cutting concern" you can imagine that if e.g. you change an aspect which matches very many joinpoints, each save & compilation cycle needs to compile a correspondingly big set of Java classes in order to do aspect weaving. And if you consider that multiple aspects can affect one class, those other aspects also need to be woven again as well. I believe that it is virtually impossible to tell what makes your compilation so slow without at least partly knowing your code base. For example:

   -- Maybe your pointcuts are very general, matching a lot of classes, and can be refined to match more exactly only those you want.

   -- Maybe your pointcuts are a bit naive, saying something like: "Log each single method call before entering and after exiting." For 18K classes this would mean a lot of recompilation whenever you change your aspect.

   -- Maybe there is a bug in AJDT. Who knows?

It is hard to tell from the prose you presented us with. Can you disclose some more information, such as paspects (especially pointcut definitions)? Verbose build logs? A code repository even?

You often say "I feel", but your feelings are not a very good debugging tool for the rest of us here. Facts over fiction, please. ;-)

Kind regards
--
Alexander Kriegisch
http://scrum-master.de


Abhishek Manocha schrieb am 06.01.2015 11:26:

I moved my project from normal java project to aspect (AJDT) and since then Aspect build is taking ages to complete.

I keep Build automatically checked in eclipse and my project has 18000+ classes

Also in my Aspect compile setting I have kept  Incremental option checked eevn then I am faraid it does Full build only.

In AJDT Event trace I can see a lot of AJC comile and woven class messages and it just keeps on going.

I also feel If in the filters I do a Selecet All to see the above the compile gets slowed.

I feel like its too problematic and not able to get it right so much so, I feel like reverting back the changes.

anybody can help for setting up AJDT with acceptable performance. I feel like I must be missing something here,

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top