Hi Ranchers,
Is there a way to improve performance of File I/O in
java beyond using BufferedReaders and BufferedInputStreams?
I have to write a piece of code which searches for some
string in a bunch of text and binary files. I have written this using BufferedReader for reading text files and BufferedInputStream for binary files. Typically I read these files in chunks of 64K bytes or chars of data.
This code takes approximately 10 minutes to parse around 1.5GB of data. Most of the execution time is spent in reading the files. Is there a way I can improve this performance? One option I can think of is invoking some code written in C/C++ for using JNI. I doubt even this approach will yield some significant performance improvement.
(I am using JDK1.4 and the system on which I am
testing is a Windows XP box with 3 GHz processor and 1GB of RAM).
Thanks in advance for any suggestion/help.
Basu.
(edited: changed the subject and question a bit. hope to get some response this time :-) )
[ March 31, 2006: Message edited by: Basudev Agrawal ]