Click to See Complete Forum and Search --> : File reading optimization


Arun Mittal
August 23rd, 2001, 04:11 AM
Hi,
We are porting an application from C to VB5 in which we are reading binary files using open method in VB5.But the time taken by VB is much more than the time taken by C to read the same file.As there are number of files to be read at a time ,overall performance of the application in VB5 is much slower than in C.
Any suggestions towards optimization of file reading will be of great help..

Thanks,
-arun

Cakkie
August 23rd, 2001, 05:40 AM
Well, Vb is very bad at handeling large strings, binary data and stuff.
One thing to do is to keep the amount you read small, rather then reading the entire file at once as a string, read it bit by bit, so the string will be smaller, and will be processed faster.

Tom Cannaerts
slisse@planetinternet.be

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook

Arun Mittal
August 24th, 2001, 05:15 AM
Thanx for the reply Tom .Do we have any API which may accomplish this faster. We have to read the files in binary mode record by record.

berta
August 24th, 2001, 05:43 AM
U could keep C procedure and put it in a API function. So U can call function from VB.

hi,brt