Bug 259586 - [itds] [incremental] optimizing itd builds
Summary: [itds] [incremental] optimizing itd builds
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows Vista
: P2 enhancement (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-23 12:22 EST by Andrew Clement CLA
Modified: 2013-06-24 11:06 EDT (History)
0 users

See Also:


Attachments
Patch for sharing target type analysis info between ITDs (7.88 KB, patch)
2009-01-20 13:24 EST, Andrew Clement CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Clement CLA 2008-12-23 12:22:10 EST
the traditional Java-ish analysis done whilst preparing for an incremental build will work for AspectJ.  But some scenarios happen in an AspectJ world that could be recognized earlier and lead to more optimal incremental builds.

For example.  An ITD from type A targets some type C.  If C is changed, it gets built, then we notice that C was depended upon by A, so we do another compile including A and C.

Now, type C is probably 99% of the time still going to be affected by the ITDs from type A.  So it would be slightly more optimal to have done the build of A and C together in the first place - i think.  This is at least worth benchmarking to see if would  make a difference if the first compile could be eliminated.
Comment 1 Andrew Clement CLA 2008-12-23 12:38:34 EST
take a look for 1.6.4
Comment 2 Andrew Clement CLA 2009-01-20 13:20:39 EST
Another optimization relates to minimizing the amount of duplicate work done when applying ITDs.  When developing an interface implementation and applying it via ITDs, typically there will be a set of ITDs together that all target the same type:

public void Target.method1() {}
public void Target.method2() {}
public void Target.method3() {}

Currently there is no shared knowledge amongst these ITDs, so for every type we come across we analyse it three separate times as to whether it is a target for each method.  Since the targets are identical we could do the analysis once and share that knowledge amongst the other similar ITDs.  In the interface case, where we are discovering the topmost implementing class (which will get the method bodies applied), this can be quite an expensive calculation that we could avoid repeating.
Comment 3 Andrew Clement CLA 2009-01-20 13:24:29 EST
Created attachment 123108 [details]
Patch for sharing target type analysis info between ITDs

First pass at the shared analysis feature.  Appears to behave but I haven't quite thought through:

- lifecycle of the analysis info, when does it get tidied up safely?
- how do declare parents damage the analysis info? Does it become stale?
Comment 4 Andrew Clement CLA 2013-06-24 11:06:56 EDT
unsetting the target field which is currently set for something already released