gcj's IO performance vs blackdown JDK

Bryce McKinlay bryce@mckinlay.net.nz
Tue Dec 2 02:24:00 GMT 2003


On Dec 2, 2003, at 5:07 AM, Christopher Marshall wrote:

> I have written a lot of programs that process huge text files a line
> at a time at my work that are 2 to three times slower running under 
> gcj than running under
> the JDK and I am pretty sure this I/O issue is the cause.
>
> run_benchmark uses Hashgen.java to generate a 100000 line text file 
> with 1000
> character lines.  On my machine (433 Mhz celeron dell laptop running 
> slackware
> linux 9.0), it takes the JDK 11.1 seconds to run line_count against 
> the file
> and it takes the gcj compiled version 34.6 seconds.

Thanks Christopher, this is a useful test case. I suspect the problem 
here is our horribly inefficient implementation of 
BufferedReader.readLine(). Given that it is calling a synchronized 
read() method in a loop for every character in the stream, I'm 
surprised its only 3x slower! You might like to have a go at making a 
more efficient implementation, or alternatively, file an "RFE" bug in 
bugzilla.

Cheers

Bryce.




More information about the Java mailing list