I ran your example of 100MB as well, and there is a difference, but far from 3x:
It is fairly obvious that this is much more dependant on the speed of the hard-disk and the IO transfer rate than the C runtime library.Code:// Using fputc() TestCRT : Ticks=12281 TestCRT : Ticks=14359 TestCRT : Ticks=12390 TestCRT : Ticks=15875 // Using fwrite() with buffer TestCRT2 : Ticks=13750 TestCRT2 : Ticks=14109 TestCRT2 : Ticks=12219 TestCRT2 : Ticks=14437 // Using WriteFile() with buffer. TestMyCode2 : Ticks=10922 TestMyCode2 : Ticks=11250 TestMyCode2 : Ticks=10531 TestMyCode2 : Ticks=10485
For VERY obvious reasons, I didn't run the original "write one byte at a time through WriteFile", as that's not sensible for this size of file.
You aren't running the DEBUG version of the CRT by any chance?