Suppose I'm writing a couple of files to disk, between 2MB and 5GB. What are sensible buffer values for the FileStream ?
Is it sensible to work with buffersizes of several megabytes, or should I stick to kilobyte-buffers ?
Suppose I'm writing a couple of files to disk, between 2MB and 5GB. What are sensible buffer values for the FileStream ?
Is it sensible to work with buffersizes of several megabytes, or should I stick to kilobyte-buffers ?
Default buffer size is 4 KiB.
Also, take a look here: Sequential File Programming Patterns and Performance with .NET
A quick little benchmark based on the document referenced shows no increase in performance on my system greater than 128KB buffer size. Your mileage may vary, feel free to use the below.