Closed Rampagy closed 3 years ago
Omg you still my idea :trollface:, I'm implement dorky
CSV import
And add kind of database infrastructure
@Rampagy pls adopt idea to make import to CVS and JSON probably nice separate single tread and multi
@Rampagy why would you convert tabs to spaces on someone else's project?
Also your WriteResults function is rather horrible. It opens and closes a file many times in a row, which adds a lot of overhead for nothing.
void WriteResults(std::string line) // Why not constant reference?
{
// Output file
std::ofstream resultsFile;
// append instead of overwrite
resultsFile.open("results.txt", std::ios_base::app);
// write line
resultsFile << line;
// close file
resultsFile.close(); // Not needed. std::ofstream uses RAII.
}
You could squeeze your shitty function to this:
void WriteResults(const std::string& line)
{
std::ofstream("results.txt", std::ios_base::app) << line;
}
So the question is why have a oneliner function at all when it just increases overhead? You could just open std::ofstream results("results.txt", std::ios_base::app)`;
at the beginning of the benchmark and call results << testHeader;
or results << instructions;
I added option
9
to consecutively run all of the tests. I also added writing the results to a fileresults.txt
. The file is placed where the application is run from.