delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/05/26/03:24:16

To: dj AT ctron DOT com (DJ Delorie)
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: Transfer buffer size; was: Library problems
Date: Thu, 26 May 94 09:57:33 +0300
From: eliz AT is DOT elta DOT co DOT il

You wrote:

> 512 is the disk block size, but 4096 is the size of the transfer
> buffer.  FILE* accesses are based on st_blksize, so it's set to 4096
> to improve performance.  BUFSIZ is also set to 4096.

512 bytes for a block is only true for disks upto 128 MB.  Disks larger than
that would have 4096 as the minimum chunk which DOS reads; disks larger than
500 MB will have it 8K.  Given this, isn't it more efficient to read at least
that much (1 cluster)?  E.g. if you read more than 4k on a 1GB disk in chunks
of 4k, you probably will read each 8k cluster twice, right?  (I know the
cache makes the second time MUCH faster, but you still are punished by DOS
overhead.)

	Eli Zaretskii

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019