Reduced buffer size used for scanning GRPs to display in the startup window from 8MB to 64K, in line with the previous commit that changed osdfunc_fileinfo(). I benchmarked this several times and could not find a case in which the 8MB buffer was faster.

git-svn-id: https://svn.eduke32.com/eduke32@7151 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2018-11-18 18:05:56 +00:00
parent a35ffd976f
commit 60e9bca926

View file

@ -366,8 +366,9 @@ static void ProcessGroups(CACHE1D_FIND_REC *srch)
char *fn;
struct Bstat st;
#define BUFFER_SIZE (1024 * 1024 * 8)
uint8_t *buf = (uint8_t *)Xmalloc(BUFFER_SIZE);
static constexpr int ReadSize = 65536;
auto *buf = (uint8_t *)Xmalloc(ReadSize);
for (sidx = srch; sidx; sidx = sidx->next)
{
@ -419,10 +420,10 @@ static void ProcessGroups(CACHE1D_FIND_REC *srch)
initprintf(" Checksumming %s...", sidx->name);
do
{
b = read(fh, buf, BUFFER_SIZE);
b = read(fh, buf, ReadSize);
if (b > 0) crcval = Bcrc32((uint8_t *)buf, b, crcval);
}
while (b == BUFFER_SIZE);
while (b == ReadSize);
close(fh);
initprintf(" Done\n");