fast way to read NON-readonly files

Discussion in 'C Programming' started by chad kline, Aug 12, 2003.

  1. chad kline

    chad kline Guest

    since i figured out the problem before my post appeared,
    and don't want to waste people's time replying - i want
    to add that the reason for the slowness in reading in
    large files was due to the failure to use "realloc()".
    the slowness was due to using malloc()/strcpy()/free().
     
    chad kline, Aug 12, 2003
    #1
    1. Advertising

  2. chad kline wrote:

    > since i figured out the problem before my post appeared,
    > and don't want to waste people's time replying - i want
    > to add that the reason for the slowness in reading in
    > large files was due to the failure to use "realloc()".
    > the slowness was due to using malloc()/strcpy()/free().


    Many applications that want improved I/O speed do not
    use realloc. The applications allocate a static buffer
    and haul a large chunk o' data into the buffer, then
    parse away.

    The goal is to keep the I/O medium in constant flow.
    When the medium stops, there will be time required
    for it to "ramp up" and seek to the previous location
    of where it started. One method to this is to reduce
    the quantity of I/O requests. One big access is
    generally faster than a whole bunch of little ones.

    --
    Thomas Matthews

    C++ newsgroup welcome message:
    http://www.slack.net/~shiva/welcome.txt
    C++ Faq: http://www.parashift.com/c -faq-lite
    C Faq: http://www.eskimo.com/~scs/c-faq/top.html
    alt.comp.lang.learn.c-c++ faq:
    http://www.raos.demon.uk/acllc-c /faq.html
    Other sites:
    http://www.josuttis.com -- C++ STL Library book
     
    Thomas Matthews, Aug 12, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. chad kline

    fastest way to load NON-readonly files.

    chad kline, Aug 12, 2003, in forum: C Programming
    Replies:
    0
    Views:
    299
    chad kline
    Aug 12, 2003
  2. Thomas Kowalski
    Replies:
    6
    Views:
    805
    Branimir Maksimovic
    May 18, 2007
  3. Replies:
    7
    Views:
    401
  4. Replies:
    0
    Views:
    353
  5. Jonathan Hyatt
    Replies:
    1
    Views:
    1,966
    Jonathan Hyatt
    Jun 8, 2004
Loading...

Share This Page