Skip to content

Commit af2ec6b

Browse files
author
MarcoFalke
committed
Merge #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
2 parents ecca2ea + fabe44e commit af2ec6b

File tree

4 files changed

+33
-7
lines changed

4 files changed

+33
-7
lines changed

src/bench/block_assemble.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@
1616

1717
static void AssembleBlock(benchmark::State& state)
1818
{
19-
RegTestingSetup test_setup;
19+
TestingSetup test_setup{
20+
CBaseChainParams::REGTEST,
21+
/* extra_args */ {
22+
"-nodebuglogfile",
23+
"-nodebug",
24+
},
25+
};
26+
2027
const std::vector<unsigned char> op_true{OP_TRUE};
2128
CScriptWitness witness;
2229
witness.stack.push_back(op_true);

src/bench/duplicate_inputs.cpp

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

1515
static void DuplicateInputs(benchmark::State& state)
1616
{
17-
RegTestingSetup test_setup;
17+
TestingSetup test_setup{
18+
CBaseChainParams::REGTEST,
19+
/* extra_args */ {
20+
"-nodebuglogfile",
21+
"-nodebug",
22+
},
23+
};
1824

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

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 sigOpCost = 4;
1717
LockPoints lp;
1818
pool.addUnchecked(CTxMemPoolEntry(
19-
tx, nFee, nTime, nHeight,
20-
spendsCoinbase, sigOpCost, lp));
19+
tx, nFee, nTime, nHeight,
20+
spendsCoinbase, sigOpCost, 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::State& state)
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: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@
1414

1515
static void WalletBalance(benchmark::State& state, const bool set_dirty, const bool add_watchonly, const bool add_mine)
1616
{
17-
RegTestingSetup test_setup;
17+
TestingSetup test_setup{
18+
CBaseChainParams::REGTEST,
19+
/* extra_args */ {
20+
"-nodebuglogfile",
21+
"-nodebug",
22+
},
23+
};
24+
1825
const auto& ADDRESS_WATCHONLY = ADDRESS_BCRT1_UNSPENDABLE;
1926

2027
NodeContext node;
@@ -25,7 +32,7 @@ static void WalletBalance(benchmark::State& state, const bool set_dirty, const b
2532
bool first_run;
2633
if (wallet.LoadWallet(first_run) != DBErrors::LOAD_OK) assert(false);
2734
}
28-
auto handler = chain->handleNotifications({ &wallet, [](CWallet*) {} });
35+
auto handler = chain->handleNotifications({&wallet, [](CWallet*) {}});
2936

3037
const Optional<std::string> address_mine{add_mine ? Optional<std::string>{getnewaddress(wallet)} : nullopt};
3138
if (add_watchonly) importaddress(wallet, ADDRESS_WATCHONLY);

0 commit comments

Comments
 (0)