@@ -96,6 +96,7 @@ static const CRPCConvertParam vRPCConvertParams[] =
|
||||
{ "zcrawjoinsplit", 3 },
|
||||
{ "zcrawjoinsplit", 4 },
|
||||
{ "zcbenchmark", 1 },
|
||||
{ "zcbenchmark", 2 },
|
||||
{ "getblocksubsidy", 0}
|
||||
};
|
||||
|
||||
|
||||
@@ -2438,7 +2438,12 @@ Value zc_benchmark(const json_spirit::Array& params, bool fHelp)
|
||||
} else if (benchmarktype == "verifyjoinsplit") {
|
||||
sample_times.push_back(benchmark_verify_joinsplit(samplejoinsplit));
|
||||
} else if (benchmarktype == "solveequihash") {
|
||||
sample_times.push_back(benchmark_solve_equihash());
|
||||
if (params.size() < 3) {
|
||||
sample_times.push_back(benchmark_solve_equihash(true));
|
||||
} else {
|
||||
int nThreads = params[2].get_int();
|
||||
sample_times.push_back(benchmark_solve_equihash_threaded(nThreads));
|
||||
}
|
||||
} else if (benchmarktype == "verifyequihash") {
|
||||
sample_times.push_back(benchmark_verify_equihash());
|
||||
} else if (benchmarktype == "validatelargetx") {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <unistd.h>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/thread.hpp>
|
||||
#include "coins.h"
|
||||
#include "util.h"
|
||||
#include "init.h"
|
||||
@@ -97,7 +98,7 @@ double benchmark_verify_joinsplit(const JSDescription &joinsplit)
|
||||
return timer_stop();
|
||||
}
|
||||
|
||||
double benchmark_solve_equihash()
|
||||
double benchmark_solve_equihash(bool time)
|
||||
{
|
||||
CBlock pblock;
|
||||
CEquihashInput I{pblock};
|
||||
@@ -116,10 +117,24 @@ double benchmark_solve_equihash()
|
||||
nonce.begin(),
|
||||
nonce.size());
|
||||
|
||||
timer_start();
|
||||
if (time)
|
||||
timer_start();
|
||||
std::set<std::vector<unsigned int>> solns;
|
||||
EhOptimisedSolveUncancellable(n, k, eh_state,
|
||||
[](std::vector<eh_index> soln) { return false; });
|
||||
if (time)
|
||||
return timer_stop();
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
double benchmark_solve_equihash_threaded(int nThreads)
|
||||
{
|
||||
boost::thread_group solverThreads;
|
||||
timer_start();
|
||||
for (int i = 0; i < nThreads; i++)
|
||||
solverThreads.create_thread(boost::bind(&benchmark_solve_equihash, false));
|
||||
solverThreads.join_all();
|
||||
return timer_stop();
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
extern double benchmark_sleep();
|
||||
extern double benchmark_parameter_loading();
|
||||
extern double benchmark_create_joinsplit();
|
||||
extern double benchmark_solve_equihash();
|
||||
extern double benchmark_solve_equihash(bool time);
|
||||
extern double benchmark_solve_equihash_threaded(int nThreads);
|
||||
extern double benchmark_verify_joinsplit(const JSDescription &joinsplit);
|
||||
extern double benchmark_verify_equihash();
|
||||
extern double benchmark_large_tx();
|
||||
|
||||
Reference in New Issue
Block a user