Add verify equihash benchmark
This commit is contained in:
parent
d44feea44c
commit
a1cd1a27ac
|
@ -70,6 +70,13 @@ zcashd_start
|
|||
zcash_rpc zcbenchmark solveequihash 10
|
||||
zcashd_stop
|
||||
|
||||
echo ""
|
||||
echo "Verify Equihash"
|
||||
echo "------------------"
|
||||
zcashd_start
|
||||
zcash_rpc zcbenchmark verifyequihash 1000
|
||||
zcashd_stop
|
||||
|
||||
echo ""
|
||||
echo ""
|
||||
echo "Memory"
|
||||
|
@ -109,3 +116,10 @@ echo "------------------"
|
|||
zcashd_massif_start
|
||||
zcash_rpc zcbenchmark verifyjoinsplit 1 "$RAWTXWITHPOUR"
|
||||
zcashd_massif_stop
|
||||
|
||||
echo ""
|
||||
echo "Verify Equihash"
|
||||
echo "------------------"
|
||||
zcashd_massif_start
|
||||
zcash_rpc zcbenchmark verifyequihash 1
|
||||
zcashd_massif_stop
|
||||
|
|
|
@ -2413,7 +2413,7 @@ Value zc_benchmark(const json_spirit::Array& params, bool fHelp)
|
|||
} else if (benchmarktype == "solveequihash") {
|
||||
sample_times.push_back(benchmark_solve_equihash());
|
||||
} else if (benchmarktype == "verifyequihash") {
|
||||
throw JSONRPCError(RPC_TYPE_ERROR, "Unimplemented");
|
||||
sample_times.push_back(benchmark_verify_equihash());
|
||||
} else {
|
||||
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid benchmarktype");
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "primitives/transaction.h"
|
||||
#include "crypto/equihash.h"
|
||||
#include "chainparams.h"
|
||||
#include "pow.h"
|
||||
|
||||
#include "zcbenchmarks.h"
|
||||
|
||||
|
@ -91,6 +92,13 @@ double benchmark_create_joinsplit()
|
|||
return ret;
|
||||
}
|
||||
|
||||
double benchmark_verify_joinsplit(const CPourTx &joinsplit)
|
||||
{
|
||||
timer_start();
|
||||
joinsplit.Verify(*pzerocashParams);
|
||||
return timer_stop();
|
||||
}
|
||||
|
||||
double benchmark_solve_equihash()
|
||||
{
|
||||
const char *testing = "testing";
|
||||
|
@ -103,9 +111,13 @@ double benchmark_solve_equihash()
|
|||
return timer_stop();
|
||||
}
|
||||
|
||||
double benchmark_verify_joinsplit(const CPourTx &joinsplit)
|
||||
double benchmark_verify_equihash()
|
||||
{
|
||||
CChainParams params = Params(CBaseChainParams::MAIN);
|
||||
CBlock genesis = Params(CBaseChainParams::MAIN).GenesisBlock();
|
||||
CBlockHeader genesis_header = genesis.GetBlockHeader();
|
||||
timer_start();
|
||||
joinsplit.Verify(*pzerocashParams);
|
||||
CheckEquihashSolution(&genesis_header, params);
|
||||
return timer_stop();
|
||||
}
|
||||
|
||||
|
|
|
@ -9,5 +9,6 @@ extern double benchmark_parameter_loading();
|
|||
extern double benchmark_create_joinsplit();
|
||||
extern double benchmark_solve_equihash();
|
||||
extern double benchmark_verify_joinsplit(const CPourTx &joinsplit);
|
||||
extern double benchmark_verify_equihash();
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue