parent
fbd90518e3
commit
f7478de67f
|
@ -77,10 +77,15 @@ case "$1" in
|
||||||
zcash_rpc zcbenchmark createjoinsplit 10
|
zcash_rpc zcbenchmark createjoinsplit 10
|
||||||
;;
|
;;
|
||||||
verifyjoinsplit)
|
verifyjoinsplit)
|
||||||
zcash_rpc zcbenchmark verifyjoinsplit 1000 "$RAWJOINSPLIT"
|
zcash_rpc zcbenchmark verifyjoinsplit 1000 "\"$RAWJOINSPLIT\""
|
||||||
;;
|
;;
|
||||||
solveequihash)
|
solveequihash)
|
||||||
zcash_rpc zcbenchmark solveequihash 10
|
if [ "$#" -ge "3" ]
|
||||||
|
then
|
||||||
|
zcash_rpc zcbenchmark solveequihash 10 "$3"
|
||||||
|
else
|
||||||
|
zcash_rpc zcbenchmark solveequihash 10
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
verifyequihash)
|
verifyequihash)
|
||||||
zcash_rpc zcbenchmark verifyequihash 1000
|
zcash_rpc zcbenchmark verifyequihash 1000
|
||||||
|
@ -108,10 +113,15 @@ case "$1" in
|
||||||
zcash_rpc zcbenchmark createjoinsplit 1
|
zcash_rpc zcbenchmark createjoinsplit 1
|
||||||
;;
|
;;
|
||||||
verifyjoinsplit)
|
verifyjoinsplit)
|
||||||
zcash_rpc zcbenchmark verifyjoinsplit 1 "$RAWJOINSPLIT"
|
zcash_rpc zcbenchmark verifyjoinsplit 1 "\"$RAWJOINSPLIT\""
|
||||||
;;
|
;;
|
||||||
solveequihash)
|
solveequihash)
|
||||||
zcash_rpc zcbenchmark solveequihash 1
|
if [ "$#" -ge "3" ]
|
||||||
|
then
|
||||||
|
zcash_rpc zcbenchmark solveequihash 1 "$3"
|
||||||
|
else
|
||||||
|
zcash_rpc zcbenchmark solveequihash 1
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
verifyequihash)
|
verifyequihash)
|
||||||
zcash_rpc zcbenchmark verifyequihash 1
|
zcash_rpc zcbenchmark verifyequihash 1
|
||||||
|
@ -137,10 +147,15 @@ case "$1" in
|
||||||
zcash_rpc zcbenchmark createjoinsplit 1
|
zcash_rpc zcbenchmark createjoinsplit 1
|
||||||
;;
|
;;
|
||||||
verifyjoinsplit)
|
verifyjoinsplit)
|
||||||
zcash_rpc zcbenchmark verifyjoinsplit 1 "$RAWJOINSPLIT"
|
zcash_rpc zcbenchmark verifyjoinsplit 1 "\"$RAWJOINSPLIT\""
|
||||||
;;
|
;;
|
||||||
solveequihash)
|
solveequihash)
|
||||||
zcash_rpc zcbenchmark solveequihash 1
|
if [ "$#" -ge "3" ]
|
||||||
|
then
|
||||||
|
zcash_rpc zcbenchmark solveequihash 1 "$3"
|
||||||
|
else
|
||||||
|
zcash_rpc zcbenchmark solveequihash 1
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
verifyequihash)
|
verifyequihash)
|
||||||
zcash_rpc zcbenchmark verifyequihash 1
|
zcash_rpc zcbenchmark verifyequihash 1
|
||||||
|
|
|
@ -96,6 +96,7 @@ static const CRPCConvertParam vRPCConvertParams[] =
|
||||||
{ "zcrawjoinsplit", 3 },
|
{ "zcrawjoinsplit", 3 },
|
||||||
{ "zcrawjoinsplit", 4 },
|
{ "zcrawjoinsplit", 4 },
|
||||||
{ "zcbenchmark", 1 },
|
{ "zcbenchmark", 1 },
|
||||||
|
{ "zcbenchmark", 2 },
|
||||||
{ "getblocksubsidy", 0}
|
{ "getblocksubsidy", 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2438,7 +2438,12 @@ Value zc_benchmark(const json_spirit::Array& params, bool fHelp)
|
||||||
} else if (benchmarktype == "verifyjoinsplit") {
|
} else if (benchmarktype == "verifyjoinsplit") {
|
||||||
sample_times.push_back(benchmark_verify_joinsplit(samplejoinsplit));
|
sample_times.push_back(benchmark_verify_joinsplit(samplejoinsplit));
|
||||||
} else if (benchmarktype == "solveequihash") {
|
} 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") {
|
} else if (benchmarktype == "verifyequihash") {
|
||||||
sample_times.push_back(benchmark_verify_equihash());
|
sample_times.push_back(benchmark_verify_equihash());
|
||||||
} else if (benchmarktype == "validatelargetx") {
|
} else if (benchmarktype == "validatelargetx") {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
|
#include <boost/thread.hpp>
|
||||||
#include "coins.h"
|
#include "coins.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
|
@ -97,7 +98,7 @@ double benchmark_verify_joinsplit(const JSDescription &joinsplit)
|
||||||
return timer_stop();
|
return timer_stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
double benchmark_solve_equihash()
|
double benchmark_solve_equihash(bool time)
|
||||||
{
|
{
|
||||||
CBlock pblock;
|
CBlock pblock;
|
||||||
CEquihashInput I{pblock};
|
CEquihashInput I{pblock};
|
||||||
|
@ -116,10 +117,24 @@ double benchmark_solve_equihash()
|
||||||
nonce.begin(),
|
nonce.begin(),
|
||||||
nonce.size());
|
nonce.size());
|
||||||
|
|
||||||
timer_start();
|
if (time)
|
||||||
|
timer_start();
|
||||||
std::set<std::vector<unsigned int>> solns;
|
std::set<std::vector<unsigned int>> solns;
|
||||||
EhOptimisedSolveUncancellable(n, k, eh_state,
|
EhOptimisedSolveUncancellable(n, k, eh_state,
|
||||||
[](std::vector<eh_index> soln) { return false; });
|
[](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();
|
return timer_stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
extern double benchmark_sleep();
|
extern double benchmark_sleep();
|
||||||
extern double benchmark_parameter_loading();
|
extern double benchmark_parameter_loading();
|
||||||
extern double benchmark_create_joinsplit();
|
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_joinsplit(const JSDescription &joinsplit);
|
||||||
extern double benchmark_verify_equihash();
|
extern double benchmark_verify_equihash();
|
||||||
extern double benchmark_large_tx();
|
extern double benchmark_large_tx();
|
||||||
|
|
Loading…
Reference in New Issue