Optimum file buffer read size?

前端 未结 2 1670
渐次进展
渐次进展 2020-11-30 11:29

I am writing an application which needs to read fairly large files. I have always wondered what\'s the optimum size for the read buffer on a modern Windows XP computer. I go

2条回答
  •  清歌不尽
    2020-11-30 11:58

    Depends on where you draw the line between access time and memory usage. The larger the buffer, the faster - but the more expensive in terms of memory. reading in multiples of your File system cluster size is probably the most efficient, in a Windows XP system using NTFS, 4K is the default cluster size.

    You can see this link Default cluster size for NTFS, FAT, and exFAT

    Bye.

提交回复
热议问题