Performances with gcj
Benjamin de Dardel
Sun Aug 10 18:17:00 GMT 2008
I had to release a program that executes an external process and gets
its standard output.
I implemented a solution with threads and pipes to redirect inputs and
outputs (cf PipeTest.java).
I choose the 'find /' command to test it.
I'm very surprised about gcj performances which are 5x slowly than sun jvm.
In fact, I expected that my compiled program would be faster than all jvm.
Do you have an idea about these differences ?
Is that the gnu classpath implementation which is quiet slow ?
# test1 : bash
$ time find /
# test2 : compilation with gcj
$ gcj --main=PipeTest -o test.bin PipeTest.java
$ time test.bin
# test3: interpretation with gij
$ gcj -C PipeTest.java
$ time gij PipeTest
# test4 : interpretation with java
$ javac PipeTest.java
$ time java PipeTest
##### compilers #####
$ gcj --version
gcj (GCC) 4.2.3 (Ubuntu 4.2.3-2ubuntu6)
$ javac -version
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2658 bytes
Desc: not available
More information about the Java