Community
Participate
Working Groups
Created attachment 78597 [details] Patch for ignoring duplicate package creation When adding a new package to a second source root that already exists in the first, unnecessary compilation can be triggered. To repro: 1. Create a new project with two source roots, src1 and src2. 2. Under src1, create two new classes, pkg1.pkg2.Foo and pkg1.pkg3.Bar. These should be empty classes with no references. 3. Make sure a full build has been performed. 4. Copy a new class, pkg1.pkg3.Baz into src2. This should not require pkg1.pkg2.Foo to get recompiled and yet incremental build triggers a recompilation of Foo. I'll attach a patch that fixes the problem in 3.3.
Any chance of getting this in for 3.3.2? We end up hitting this case somewhat frequently in APT when files are generated, and it doubles the compile time. Thanks much.
Jess - exactly how slow is "double the build time" ? For a common case, how long is an incremental build with/without the patch ?
For one particular case, the compilation took 5 minutes without the patch, and 2.5 with it. Note that this was using a particularly slow processor, but it essentially made an incremental build into a full build.
Sorry was that 2.5 seconds or minutes with the patch ? Cause if its 2.5 minutes, then we still have an issue since adding a new class to an 'empty' source folder should be very quick if the package 'exists'.
2.5 minutes in this particular case, but almost all of that time was spent in the processor, and isn't JDT's fault.
Created attachment 79308 [details] Proposed patch Copied the package detection case from IncrementalImageBuilder findAffectedSourceFiles()
Released into HEAD
Fantastic, thanks! Any chance of applying this to 3.3.2 as well?
Philippe - need a +1 for 3.3.2
One question: in the updated patch, you only avoid recompilation if there is more than one source root. Is that a valid check? What if the package already exists in binary and you add a source version of the same package?
The call newState.isKnownPackage() only checks the packages of the source files in the project. It doesn't know all packages on the classpath.
+1 for 3.3.2
Released for 3.3.2
Verified for 3.4M3 using I20071029-0010 build.
Doubling the compile time is very bad. This fix needs to be included in 3.3.2. Philippe please approve.
This fix was already committed to 3.3.2 by Kent on 2007-10-09. Thanks again for getting this in.
It is released, but wasn't officially blessed by PMC, as per 3.3.2 process. +1 for 3.3.2
Verified for 3.3.2 using M20080123-0800 build