Write data of the same size 1 time times size,10 times size,100 times, respectively, and test large file writes and memory copies respectively.
Tfwrite woaoniyoujifen,yueliangdaibiaowodexin!
Small write 100w times begin ...
Begin sec[1433735551], microsec[956743]
Small write 100w time over.
End sec[1433735553], microsec[550436]
Large write 10w times begin ...
Begin sec[1433735553], microsec[550470]
Large write 10w times end.
End sec[1433735553], microsec[719068]
Superlarge write 1w times begin ...
Begin sec[1433735553], microsec[719078]
Superlarge Write 1w times end.
End sec[1433735553], microsec[782787]
Begin to 100w small strcpy
Begin sec[1433735553], microsec[801839]
100w small strcpy over.
End sec[1433735553], microsec[879082]
Begin to 10w large strcpy
Begin sec[1433735553], microsec[885847]
10w Large strcpy over.
End sec[1433735553], microsec[930263]
Begin to 1w Superlarge strcpy
Begin sec[1433735553], microsec[936975]
1w Superlarge strcpy over.
End sec[1433735553], microsec[978766]
From the test results, it is only 1 time times the gap between memory and hard disk in large file write. should be hard disk and memory IO efficiency difference is not too big, file write and memory write really pull up is random small file read and write, hard disk need seek, memory address directly access. As for 1 time times the size of the file write and 10 times times the size of the file write there is a 8 times-fold gap, which may be related to frequent kernel switching.
What is the difference between hard-disk writes and memory writes?