CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2001
    Posts
    10

    File reading optimization

    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




  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: File reading optimization

    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
    [email protected]

    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
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  3. #3
    Join Date
    Aug 2001
    Posts
    10

    Re: File reading optimization

    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.



  4. #4

    Re: File reading optimization

    U could keep C procedure and put it in a API function. So U can call function from VB.

    hi,brt


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured