mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 20:03:34 -03:00
Merge #18759: bench: Start nodes with -nodebuglogfile
fabe44e815
bench: Start nodes with -nodebuglogfile (MarcoFalke) Pull request description: For benchmarking we don't want to depend on the speed of the disk or the amount of debug logging ACKs for top commit: fanquake: ACKfabe44e815
- This makes some of these benchmarks significantly faster to run. MempoolEviction total runtime is down from ~46s to 11s on my machine: Tree-SHA512: d99700901650325896b9115d20b84a27042152f46266f595bf7ea1414528c0b346f4e707a12ee8b8ba99c35cf155e645e67971c1b2a679c4e609c400ff8b08ae
This commit is contained in:
commit
af2ec6b037
4 changed files with 33 additions and 7 deletions
|
@ -16,7 +16,14 @@
|
|||
|
||||
static void AssembleBlock(benchmark::State& state)
|
||||
{
|
||||
RegTestingSetup test_setup;
|
||||
TestingSetup test_setup{
|
||||
CBaseChainParams::REGTEST,
|
||||
/* extra_args */ {
|
||||
"-nodebuglogfile",
|
||||
"-nodebug",
|
||||
},
|
||||
};
|
||||
|
||||
const std::vector<unsigned char> op_true{OP_TRUE};
|
||||
CScriptWitness witness;
|
||||
witness.stack.push_back(op_true);
|
||||
|
|
|
@ -14,7 +14,13 @@
|
|||
|
||||
static void DuplicateInputs(benchmark::State& state)
|
||||
{
|
||||
RegTestingSetup test_setup;
|
||||
TestingSetup test_setup{
|
||||
CBaseChainParams::REGTEST,
|
||||
/* extra_args */ {
|
||||
"-nodebuglogfile",
|
||||
"-nodebug",
|
||||
},
|
||||
};
|
||||
|
||||
const CScript SCRIPT_PUB{CScript(OP_TRUE)};
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@ static void AddTx(const CTransactionRef& tx, const CAmount& nFee, CTxMemPool& po
|
|||
unsigned int sigOpCost = 4;
|
||||
LockPoints lp;
|
||||
pool.addUnchecked(CTxMemPoolEntry(
|
||||
tx, nFee, nTime, nHeight,
|
||||
spendsCoinbase, sigOpCost, lp));
|
||||
tx, nFee, nTime, nHeight,
|
||||
spendsCoinbase, sigOpCost, lp));
|
||||
}
|
||||
|
||||
// Right now this is only testing eviction performance in an extremely small
|
||||
|
@ -25,7 +25,13 @@ static void AddTx(const CTransactionRef& tx, const CAmount& nFee, CTxMemPool& po
|
|||
// unique transactions for a more meaningful performance measurement.
|
||||
static void MempoolEviction(benchmark::State& state)
|
||||
{
|
||||
RegTestingSetup test_setup;
|
||||
TestingSetup test_setup{
|
||||
CBaseChainParams::REGTEST,
|
||||
/* extra_args */ {
|
||||
"-nodebuglogfile",
|
||||
"-nodebug",
|
||||
},
|
||||
};
|
||||
|
||||
CMutableTransaction tx1 = CMutableTransaction();
|
||||
tx1.vin.resize(1);
|
||||
|
|
|
@ -14,7 +14,14 @@
|
|||
|
||||
static void WalletBalance(benchmark::State& state, const bool set_dirty, const bool add_watchonly, const bool add_mine)
|
||||
{
|
||||
RegTestingSetup test_setup;
|
||||
TestingSetup test_setup{
|
||||
CBaseChainParams::REGTEST,
|
||||
/* extra_args */ {
|
||||
"-nodebuglogfile",
|
||||
"-nodebug",
|
||||
},
|
||||
};
|
||||
|
||||
const auto& ADDRESS_WATCHONLY = ADDRESS_BCRT1_UNSPENDABLE;
|
||||
|
||||
NodeContext node;
|
||||
|
@ -25,7 +32,7 @@ static void WalletBalance(benchmark::State& state, const bool set_dirty, const b
|
|||
bool first_run;
|
||||
if (wallet.LoadWallet(first_run) != DBErrors::LOAD_OK) assert(false);
|
||||
}
|
||||
auto handler = chain->handleNotifications({ &wallet, [](CWallet*) {} });
|
||||
auto handler = chain->handleNotifications({&wallet, [](CWallet*) {}});
|
||||
|
||||
const Optional<std::string> address_mine{add_mine ? Optional<std::string>{getnewaddress(wallet)} : nullopt};
|
||||
if (add_watchonly) importaddress(wallet, ADDRESS_WATCHONLY);
|
||||
|
|
Loading…
Reference in a new issue