Jack Grigg
7 years ago
No known key found for this signature in database
GPG Key ID: 665DBCD284F7DAFF
4 changed files with
20 additions and
2 deletions
-
qa/zcash/performance-measurements.sh
-
src/wallet/rpcwallet.cpp
-
src/zcbenchmarks.cpp
-
src/zcbenchmarks.h
|
|
@ -56,7 +56,7 @@ function use_200k_benchmark { |
|
|
|
|
|
|
|
function zcashd_start { |
|
|
|
case "$1" in |
|
|
|
sendtoaddress|loadwallet) |
|
|
|
sendtoaddress|loadwallet|listunspent) |
|
|
|
case "$2" in |
|
|
|
200k-recv) |
|
|
|
use_200k_benchmark 0 |
|
|
@ -86,7 +86,7 @@ function zcashd_stop { |
|
|
|
|
|
|
|
function zcashd_massif_start { |
|
|
|
case "$1" in |
|
|
|
sendtoaddress|loadwallet) |
|
|
|
sendtoaddress|loadwallet|listunspent) |
|
|
|
case "$2" in |
|
|
|
200k-recv) |
|
|
|
use_200k_benchmark 0 |
|
|
@ -206,6 +206,9 @@ case "$1" in |
|
|
|
loadwallet) |
|
|
|
zcash_rpc zcbenchmark loadwallet 10 |
|
|
|
;; |
|
|
|
listunspent) |
|
|
|
zcash_rpc zcbenchmark listunspent 10 |
|
|
|
;; |
|
|
|
*) |
|
|
|
zcashd_stop |
|
|
|
echo "Bad arguments to time." |
|
|
@ -250,6 +253,9 @@ case "$1" in |
|
|
|
loadwallet) |
|
|
|
# The initial load is sufficient for measurement |
|
|
|
;; |
|
|
|
listunspent) |
|
|
|
zcash_rpc zcbenchmark listunspent 1 |
|
|
|
;; |
|
|
|
*) |
|
|
|
zcashd_massif_stop |
|
|
|
echo "Bad arguments to memory." |
|
|
|
|
|
@ -2609,6 +2609,8 @@ UniValue zc_benchmark(const UniValue& params, bool fHelp) |
|
|
|
throw JSONRPCError(RPC_TYPE_ERROR, "Benchmark must be run in regtest mode"); |
|
|
|
} |
|
|
|
sample_times.push_back(benchmark_loadwallet()); |
|
|
|
} else if (benchmarktype == "listunspent") { |
|
|
|
sample_times.push_back(benchmark_listunspent()); |
|
|
|
} else { |
|
|
|
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid benchmarktype"); |
|
|
|
} |
|
|
|
|
|
@ -465,3 +465,12 @@ double benchmark_loadwallet() |
|
|
|
post_wallet_load(); |
|
|
|
return res; |
|
|
|
} |
|
|
|
|
|
|
|
double benchmark_listunspent() |
|
|
|
{ |
|
|
|
UniValue params(UniValue::VARR); |
|
|
|
struct timeval tv_start; |
|
|
|
timer_start(tv_start); |
|
|
|
auto unspent = listunspent(params, false); |
|
|
|
return timer_stop(tv_start); |
|
|
|
} |
|
|
|
|
|
@ -18,5 +18,6 @@ extern double benchmark_increment_note_witnesses(size_t nTxs); |
|
|
|
extern double benchmark_connectblock_slow(); |
|
|
|
extern double benchmark_sendtoaddress(CAmount amount); |
|
|
|
extern double benchmark_loadwallet(); |
|
|
|
extern double benchmark_listunspent(); |
|
|
|
|
|
|
|
#endif |
|
|
|