This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Workflow and Compiling an Application


>>>>> "Michael" == Michael J McGonagle <fndsnd@earthlink.net> writes:

Michael> My question, is there any difference in compile times with
Michael> 'gcj' depending on the format of the input (*.java
Michael> vs. *.class). I figure my work/compile flow would be as
Michael> follows:

Michael> 1. Compile using 'jikes' to *.class
Michael> 	(from here I can test the code with 'java' or 'kaffe')
Michael> 2. Compile using 'gcl' to binary

gcj in theory generates better code (though I've never measured how
much better) if you compile from .java.  OTOH this is a bit slower.
One approach would be to compile to .class and then use gcj to compile
from .java->.o.  This way gcj will use the .class files when it needs
info from other classes -- so you'll get the best of both (in theory).

You can use `gcj -C' instead of jikes to compile to .class files.  If
you compile all your files like this with a single gcj invocation, it
is actually pretty fast.

Unfortunately gcj has a number of divergences from the standard right
now.  That is, known bugs.  So while it is useful in many situations,
and while the bugs don't seem to affect most typical Java code, it
does mean that gcj isn't the best choice for determining whether your
code is standards-compliant.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]