Skip to content

Instantly share code, notes, and snippets.

@agborkowski
Created August 25, 2012 16:48
Show Gist options
  • Save agborkowski/3467776 to your computer and use it in GitHub Desktop.
Save agborkowski/3467776 to your computer and use it in GitHub Desktop.
c::max write speed::ssd
#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