I've played a little bit with this. Wrote a small code to test speed. It writes a 3GB binary file.
static void Main(string[] args)
{
if (args.Length != 1)
{
return;
}
var bytes = Guid.NewGuid().ToByteArray();
var watch = new Stopwatch();
using (var stream = new FileStream(args[0], FileMode.CreateNew))
{
watch.Start();
for (long i = 0; i < 200000000; i++)
{
stream.Write(bytes, 0, bytes.Length);
}
watch.Stop();
}
Console.WriteLine(watch.Elapsed);
}
I intentionally wrote my own too see perf at high level as visible to apps. I also wanted to measure writing before closing stream. Closing stream could cause flushing cache and I wanted to measure without flushing cache.
I used old SATA SSD OSZ Vertex 2 60GB. It allows enabling cache on it. I tested with cache enabled and disabled and there was not difference in performance. Windows caching does not seem to make a difference in case of SSD.
But I also discovered that that extremely old SATA SSD (5+ years old) was 10% faster than Intel 750 PCIe drive. How come? Intel 750 PCIe is advertised to be 4 times faster than the fastest SATA SSD. Any suggestions how to get the advertised performance?