Created
August 25, 2012 16:48
-
-
Save agborkowski/3467776 to your computer and use it in GitHub Desktop.
c::max write speed::ssd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
const unsigned long long size = 8ULL*1024ULL*1024ULL; unsigned long long a[size]; | |
int main() | |
{ | |
FILE* pFile; | |
pFile = fopen("file.binary", "wb"); | |
for (unsigned long long j = 0; j < 1024; ++j){ | |
//Some calculations to fill a[] | |
fwrite(a, 1, size*sizeof(unsigned long long), pFile); } | |
fclose(pFile); | |
return 0; } | |
/** | |
* PanicSheep 841 | |
* I just timed 8GB in 36sec, which is about 220MB/s and I think that maxes out my SSD. Also worth to note, the code at the | |
* beginning of my post used one core 100%, whereas this code only uses 2-5%. | |
* Thanks a lot to everyone. | |
**/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment