Performances with gcj

David Daney
Mon Aug 11 04:10:00 GMT 2008

Benjamin de Dardel wrote:
> Hi all,
> 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
> 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 ?
I have not profiled it, but it is not too surprising.

You could try buffering the process' input stream before sending it 
through the InputStreamReader.

I suspect that the slowdown is in the character set conversion.  You are 
using the default converter.  You could also try something like US-ASCII 
and see if that speeds things up.

David Daney

More information about the Java mailing list