Measure multithreaded solveequihash time per-thread

This commit is contained in:
Jack Grigg
2016-08-11 00:45:31 +12:00
parent 80259d4b4f
commit 9e52ca3205
3 changed files with 52 additions and 37 deletions

View File

@@ -2447,10 +2447,11 @@ Value zc_benchmark(const json_spirit::Array& params, bool fHelp)
sample_times.push_back(benchmark_verify_joinsplit(samplejoinsplit));
} else if (benchmarktype == "solveequihash") {
if (params.size() < 3) {
sample_times.push_back(benchmark_solve_equihash(true));
sample_times.push_back(benchmark_solve_equihash());
} else {
int nThreads = params[2].get_int();
sample_times.push_back(benchmark_solve_equihash_threaded(nThreads));
std::vector<double> vals = benchmark_solve_equihash_threaded(nThreads);
sample_times.insert(sample_times.end(), vals.begin(), vals.end());
}
} else if (benchmarktype == "verifyequihash") {
sample_times.push_back(benchmark_verify_equihash());
@@ -2462,9 +2463,9 @@ Value zc_benchmark(const json_spirit::Array& params, bool fHelp)
}
Array results;
for (int i = 0; i < samplecount; i++) {
for (auto time : sample_times) {
Object result;
result.push_back(Pair("runningtime", sample_times.at(i)));
result.push_back(Pair("runningtime", time));
results.push_back(result);
}