Our .NET app copies large files, and needs to give the user feedback; so rather than use File.Copy we read a chunk of one file and write it to the other, and display the progress after each chunk. Nothing out of the ordinary. But what’s the right size of chunk to use, to give the fastest file copy, assuming the time to display the progress is negligible?
Our .NET app copies large files, and needs to give the user feedback; so
Share
You should consider using win32 function CopyFileTransacted (Vista Only) or CopyFileEx (Windows 2000 and higher). These are provided by Windows and are optimized for speed.
I would recommend you to test your custom C# implementation performance and compare it to native File.Copy performance. If the performance is comparable (i.e. same order of magnitude) than go with your custom C# implementation. Otherwise it’s better to use CopyFileTransacted or CopyFileEx function.
P.s. from here: