file read/write buffer sizes

Started by
1 comment, last by a38750 23 years ago
I recently made a program that packs/unpacks files. I used a loop, copying 1mb at a time until done. Now I know that if I had copied 1 byte at a time it''d be really slow, but at what point does a bigger buffer not cause any speed improvements? I mean if I read 100mb into a buffer (assuming there''s the ram) the hard drive couldn''t do that in 1 go like a smaller chunk. It''d be useful to know cos I don''t want to waste ram with a huge buffer (even if it is temporary) that doesn''t help speed, but I don''t want to restrict the speed with a buffer that''s too small. Hope I''m making sense, thanks
Advertisement
I''m not sure, just guessing, but I''d guess around 32 or 64k.

Do some performance test & find out

Magmai Kai Holmlor
- The disgruntled & disillusioned
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
File I/O is already buffered. Why buffer the buffer?

This topic is closed to new replies.

Advertisement