On Jan 2, 6:07 am, RedGrittyBrick <
[email protected]>
wrote:
Aryeh M. Friedman wrote:
On Jan 2, 5:05 pm, "Aryeh M. Friedman" <
[email protected]>
wrote:
I have a very large project that would take to long ...
Idea. Get a faster box or be more patient.
--
Andrew Thompsonhttp://pscode.org/
Not to bragging but quad core running at 2.58 GHz and 4 GB of RAM with
a sata 300 drive should be enough... and as far as patience goes I
think 5 mins to recompile for a 1 one line change is insane
(exspecially when we do this on a quite regular basis [say 20 times an
hour])
That does indeed sound insane. How can javac's speed be an issue? Do you
have a single .java file containing a titanic amount of code? Are you
asking javac to compile .java files that don't need compiling? (if so why?)
Either you are doing something rather unusual or my knowledge of Java is
incomplete in some interesting way - please enlighten me.
About 80% of that time is taken up by the import scanner (needs to
read about 5,000 files)
What is the "import scanner"? Can you not run it if imports haven't
changed, or do you have to run it every time you compile a small
change?
and the start/stop time for javac....
The clear solution here is to reduce the number of times javac starts
and stops. If you have to compile a single source file at a time, then
you can't really do anything here. However, if you have the ability to
generate a list of files that need recompiled, javac can accept lists
of files:
http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javac.html
And you can eliminate start/stop overhead by generating the list first
then running javac only once.
part of
the issue (and there is no progrmatic way around this I can think of)
is if class Y depends on X and X was recompiled then Y is also
recompiled (make and all it's variants also do this and do a much
worse job then cook does at it)
There is no good programmatic way around this, you are correct. The
compiler would have to track information about what parts of X were
relevant to Y, then analyze your code changes to determine if any of
those relevant parts had changed, and only recompile Y if they have.
This is not trivial, and javac does not do it. Note, however, that
certain design techniques can significantly reduce interdependency
between classes; e.g. copious use of interfaces, more specific classes
(e.g. if Y depends on one part of X that is frequently changing, and Z
depends on another part of X, perhaps it is more appropriate to split
X into two more specific classes), anything that increases the
modularity and isolation of your code will help reduce dependencies.
Jason