Using FILE_FLAG_NO_BUFFERING will return noticeable speed gain?

Oh Lord no. You make it dramatically slower by using that flag. It bypasses the file system cache, that wonderful piece of code that can guess with almost psychic accuracy that you'll want to read sector N+1 after reading N. And just pre-loads it if it is cheap to get.

It is especially bad for writing, which is why the option exists, you don't get the lazy write-back. Which means that your program can only run as fast as the disk can write. Which is very, very slow. The advantage of the flag is that you can be sure it was written. Helps implementing transactional disk updates, the kind that dbase engines care about.

But try this for yourself to see the effect.


No, this flag is not for typical disk users. It is for programs like databases where they need to perform their own file cache management for optimal performance. While I'm sure you could find situations where it would speed up your program, for the most part you would want to use the OS-provided buffering -- that's why it's there.