Skip to content

Commit fa9e34c

Browse files
MarcoFalkePastaPastaPasta
authored andcommitted
Merge bitcoin#18759: bench: Start nodes with -nodebuglogfile
fabe44e 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: ACK fabe44e - 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
1 parent 26211cc commit fa9e34c

File tree

4 files changed

+31
-7
lines changed

4 files changed

+31
-7
lines changed

src/bench/block_assemble.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@
1717

1818
static void AssembleBlock(benchmark::Bench& bench)
1919
{
20-
RegTestingSetup test_setup;
20+
TestingSetup test_setup{
21+
CBaseChainParams::REGTEST,
22+
/* extra_args */ {
23+
"-nodebuglogfile",
24+
"-nodebug",
25+
},
26+
};
2127
const CScript redeemScript = CScript() << OP_DROP << OP_TRUE;
2228
const CScript SCRIPT_PUB =
2329
CScript() << OP_HASH160 << ToByteVector(CScriptID(redeemScript))

src/bench/duplicate_inputs.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515

1616
static void DuplicateInputs(benchmark::Bench& bench)
1717
{
18-
RegTestingSetup test_setup;
18+
TestingSetup test_setup{
19+
CBaseChainParams::REGTEST,
20+
/* extra_args */ {
21+
"-nodebuglogfile",
22+
"-nodebug",
23+
},
24+
};
1925

2026
const CScript SCRIPT_PUB{CScript(OP_TRUE)};
2127

src/bench/mempool_eviction.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,22 @@ static void AddTx(const CTransactionRef& tx, const CAmount& nFee, CTxMemPool& po
1616
unsigned int sigOps = 1;
1717
LockPoints lp;
1818
pool.addUnchecked(CTxMemPoolEntry(
19-
tx, nFee, nTime, nHeight,
20-
spendsCoinbase, sigOps, lp));
19+
tx, nFee, nTime, nHeight,
20+
spendsCoinbase, sigOps, lp));
2121
}
2222

2323
// Right now this is only testing eviction performance in an extremely small
2424
// mempool. Code needs to be written to generate a much wider variety of
2525
// unique transactions for a more meaningful performance measurement.
2626
static void MempoolEviction(benchmark::Bench& bench)
2727
{
28-
RegTestingSetup test_setup;
28+
TestingSetup test_setup{
29+
CBaseChainParams::REGTEST,
30+
/* extra_args */ {
31+
"-nodebuglogfile",
32+
"-nodebug",
33+
},
34+
};
2935

3036
CMutableTransaction tx1 = CMutableTransaction();
3137
tx1.vin.resize(1);

src/bench/wallet_balance.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515

1616
static void WalletBalance(benchmark::Bench& bench, const bool set_dirty, const bool add_watchonly, const bool add_mine, const uint32_t epoch_iters)
1717
{
18-
RegTestingSetup test_setup;
18+
TestingSetup test_setup{
19+
CBaseChainParams::REGTEST,
20+
/* extra_args */ {
21+
"-nodebuglogfile",
22+
"-nodebug",
23+
},
24+
};
1925
const auto& ADDRESS_WATCHONLY = ADDRESS_B58T_UNSPENDABLE;
2026

2127
CWallet wallet{test_setup.m_node.chain.get(), "", CreateMockWalletDatabase()};
@@ -24,7 +30,7 @@ static void WalletBalance(benchmark::Bench& bench, const bool set_dirty, const b
2430
bool first_run;
2531
if (wallet.LoadWallet(first_run) != DBErrors::LOAD_OK) assert(false);
2632
}
27-
auto handler = test_setup.m_node.chain->handleNotifications({ &wallet, [](CWallet*) {} });
33+
auto handler = test_setup.m_node.chain->handleNotifications({&wallet, [](CWallet*) {}});
2834

2935
const std::optional<std::string> address_mine{add_mine ? std::optional<std::string>{getnewaddress(wallet)} : std::nullopt};
3036
if (add_watchonly) importaddress(wallet, ADDRESS_WATCHONLY);

0 commit comments

Comments
 (0)