On 19 Jun 2003 at 16:13, P Witte wrote:

> 
> A question: A program uses io.fstrg/iob.fmul to load files in smaller chunks
> for scanning. The files could be of any size on any media (first of all hard
> disks). What, theoretically, is the smallest efficient buffer size to use?
> (Im thinking *speed* here.) Eg 512 bytes, as a whole sector can be loaded in
> at once? Or allocation unit size? Or any arbitrary size that best suits my
> program?

If you're thinking "speed", then the larger the buffer, the better - reading 
the data in small chunks will always cost more time.
If at all possible use a buffer for the entire file & (scatter) read it in.
"Sector" (512 bytes) sized buffers don't make that much sense IMHO, 
since the file data doesn't occupy the whole of the first sector (there's 
the file header), so reading the first 512 bytes from a file will read from 
2 separate sectors.

Wolfgang

Reply via email to