• No replies
2768 Posts

Pinned topic Performance of reading binary files?

‏2009-12-29T10:50:48Z |

I'm not sure that was posted in appropriate place, so duplicating it here also.

I'm experiencing considerable performance problems while reading relatively large binary files (written by C++ application) in java application running on AIX box.
I need to retrieve a list of items from 140MB binary file and I'm using java nio FileChannel:

FileChannel fc = new FileInputStream(fileName).getChannel();
Long size = fc.size()/RECORD_SIZE;//RECORD_SIZE = 704 bytes
MappedByteBuffer bb =, 0, fc.size());
for (long i = 0; i < size; i++){
//extracting one item
Item = new Item();

My laptop with Windows is able to accomplish described task in less them 2 seconds but on AIX box it takes up to 8 seconds.

Does anybody have any idea on what I'm doing wrong? Or how can performance be improved?

Thanks in advance,

AIX hardware configuration:
Processor Implementation Mode: POWER 5
Processor Version: PV_5_2
Number Of Processors: 8
Processor Clock Speed: 1499 MHz
CPU Type: 64-bit
Kernel Type: 64-bit
Memory Size: 31872 MB
Good Memory Size: 31872 MB
Full Core: false