This is the mail archive of the
java-patches@sources.redhat.com
mailing list for the Java project.
PATCH: Speed up libgcj build
- To: java-patches at sourceware dot cygnus dot com
- Subject: PATCH: Speed up libgcj build
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Fri, 13 Oct 2000 18:30:20 +1300
This patch speeds up the .java->object file stage of the libgcj build
quite a lot. It appears that passing the -I flag to gcj forced it to
only parse .java source files and not use the already-built .class files
for its dependencies (which is much faster). With this, the time to
build java/lang/String.java, for example, goes from about 1.5 seconds to
90ms for me.
Random notes/question:
1. Running "sh ./libtool --mode=compile" for every single .java file is
now actually far slower than running the compiler itself. I really wish
we could avoid it.
2. Can someone remind me why the .java->.class stage was changed to run
gcj separately for every file? This is now the slowest part of the
compile by far. At least with the old way there was a chance that "gcj
-C" would one day be upgraded so that it produces .class files as it
traverses its dependencies (rather than parse all the source code again,
and again, and again...)
3. It would be really nice if we had proper dependencies for all the
.java files so changing one line of code doesn't cause the entire
library to be rebuilt...
regards
[ bryce ]
2000-10-13 Bryce McKinlay <bryce@albatross.co.nz>
* configure.in: Don't pass -I flag to gcj.
* Makefile.am (GCJCOMPILE): Pass --tag argument to libtool.
Index: configure.in
===================================================================
RCS file: /cvs/java/libgcj/libjava/configure.in,v
retrieving revision 1.63
diff -u -r1.63 configure.in
--- configure.in 2000/10/09 17:19:49 1.63
+++ configure.in 2000/10/13 05:11:07
@@ -602,7 +602,6 @@
# Create it, so that compile/link tests don't fail
test -f libgcj.spec || touch libgcj.spec
-GCJ="$GCJ -I$srcdir"
LT_AC_PROG_GCJ
Index: Makefile.am
===================================================================
RCS file: /cvs/java/libgcj/libjava/Makefile.am,v
retrieving revision 1.92
diff -u -r1.92 Makefile.am
--- Makefile.am 2000/10/13 04:45:57 1.92
+++ Makefile.am 2000/10/13 05:11:09
@@ -65,7 +65,7 @@
ZIP = $(MULTIBUILDTOP)../$(COMPPATH)/zip/zip$(EXEEXT)
endif # CANADIAN
-GCJCOMPILE = $(LIBTOOL) --mode=compile $(GCJ) -fassume-compiled -fclasspath=$(here) -L$(here) $(JC1FLAGS) -c
+GCJCOMPILE = $(LIBTOOL) --tag=GCJ --mode=compile $(GCJ) -fassume-compiled -fclasspath=$(here) -L$(here) $(JC1FLAGS) -c
GCJLINK = $(LIBTOOL) --mode=link $(GCJ) -L$(here) $(JC1FLAGS) $(LDFLAGS) -o $@
LIBLINK = $(LIBTOOL) --mode=link $(CC) -L$(here) $(JC1FLAGS) $(LDFLAGS) -o $@