2010-02-16

Java jre performance (gcj vs Sun)

Generating a pdf from docbook xml using Apache fop like this:
fop -xml $xmlfile -xsl $XSLFILE -pdf $pdffile
takes about 40 seconds on Debian on an old Pentium 4.

But it takes 12-13 minutes on Debian inside Virtualbox on a Core 2 Duo ??

This difference too big to attribute to virtualization alone!!

fop uses java...
paul@deb503:/usr/lib/jvm$ ls -l

total 4.0K
lrwxrwxrwx 1 root root 8 2010-01-15 22:51 default-java -> java-gcj
drwxr-xr-x 5 root root 4.0K 2009-10-28 14:16 java-1.5.0-gcj-4.3-1.5.0.0
lrwxrwxrwx 1 root root 26 2009-10-28 14:16 java-gcj -> java-1.5.0-gcj-4.3-1.5.0.0


Let's try Java from Sun instead of java-gcj...

paul@deb503:~/lt$ ls -l /usr/lib/jvm/
total 8.0K
lrwxrwxrwx 1 root root 14 2010-02-16 12:17 default-java -> java-1.5.0-sun
drwxr-xr-x 5 root root 4.0K 2009-10-28 14:16 java-1.5.0-gcj-4.3-1.5.0.0
lrwxrwxrwx 1 root root 23 2010-02-16 12:15 java-1.5.0-sun -> java-1.5.0-sun-1.5.0.17
drwxr-xr-x 6 root root 4.0K 2010-02-16 12:15 java-1.5.0-sun-1.5.0.17
lrwxrwxrwx 1 root root 26 2009-10-28 14:16 java-gcj -> java-1.5.0-gcj-4.3-1.5.0.0


32 seconds!! What !? Yep, speed increase from 12-13 minutes to 32 seconds.

I double tested by putting the symlink back to java-gcj, it took 12'35" again!

I'm amazed ;-)

1 comment:

Unknown said...

GCJ is way behind HotSpot on all fronts. Try compiling fop with Excelsior JET.