I have a C++ program to write stuffs to a file, but the write speed is extremely low.
Here's it:
#include <string>
#include <fstream>
#include <limits.h>
#include <iostream>
int main()
{
std::ofstream file("Important.txt");
for (int i = 0; i < INT_MAX; i++)
{
file << 0;
}
file.close();
return 0x45;
}
The write speed barely reaches 5.6 mbps (as task manager shows).
Then I tried with win32 api, but the write speed barely reached 0.5 mpbs (also according to taskmanager)
I have seen programs write speeds upto 130 mbps on my drive. I also tried Crystal Disk Mark 8 to check my write speeds and it shows around 135 mbps. Any suggestions on how to increase disk write speed.
I don't think this is a duplicate of This. I just want to write simple strings
and int
to the file