Re: Performances with gcj

David Daney <[email protected]>
Newsgroups gmane.comp.gcc.java.devel
Message-ID <[email protected]>
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 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 ?
>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.