Very slow compiler?

Bryce McKinlay
Mon Sep 25 01:59:00 GMT 2000

My libgcj build has suddenly become extremely slow. Each class file is currently taking around 5-10 seconds to compile on my 450mhz machine, far longer than it should.

The slowdown is dependent on which directory the compiler is run from:

[bryce@hokkaido libgcj]$ pwd
[bryce@hokkaido libgcj]$ time gcj -C libjava/java/io/
0.03user 0.00system 0:00.07elapsed 42%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (475major+302minor)pagefaults 0swaps


[bryce@hokkaido libgcj]$ cd libjava/
[bryce@hokkaido libjava]$ time gcj -C java/io/
2.86user 0.57system 0:10.72elapsed 31%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (482major+3100minor)pagefaults 0swaps


Further investigation running jc1 without "-quiet" shows that it is looking at hundreds of class files that it shouldn't:

[bryce@hokkaido libjava]$ /usr/local/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.96/jc1
java/io/ -v -dumpbase -g1 -
version -fsyntax-only -femit-class-files
jc1: Unrecognized option `-v'
GNU Java version 2.96 20000924 (experimental) (i686-pc-linux-gnu) compiled by GN
U C version 2.96 20000905 (experimental).
options passed:  -v -g1 -fsyntax-only -femit-class-files
options enabled:  -fpeephole -ffunction-cse -fkeep-static-consts
 -fsyntax-only -fpcc-struct-return -fsched-interblock -fsched-spec
 -fbranch-count-reg -fnew-exceptions -fcommon -fgnu-linker -fargument-alias
 -fident -fmath-errno -fbounds-check -m80387 -mhard-float -mno-soft-float
 -mieee-fp -mfp-ret-in-387
 interface class cl
ass innerclass$1 int
erface class java.util.Hashtable innerclass java.util.Hasht
able$HashtableEntry innerclass java.util.Hashtable$HashtableEnumeration innercla
ss java.util.Hashtable$HashtableSet innerclass java.util.Hashtable$HashtableColl
ection innerclass java.util.Hashtable$HashtableIterator [etc etc etc..........]

When run in a different directory, it doesn't have this problem. Only the correct list of dependencies are loaded.


  [ bryce ]

More information about the Java mailing list