diff options
Diffstat (limited to 'src/bench')
-rw-r--r-- | src/bench/block_assemble.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/bench/block_assemble.cpp b/src/bench/block_assemble.cpp index 63acb6c24d..8dd4117a3e 100644 --- a/src/bench/block_assemble.cpp +++ b/src/bench/block_assemble.cpp @@ -5,6 +5,7 @@ #include <bench/bench.h> #include <consensus/validation.h> #include <crypto/sha256.h> +#include <node/miner.h> #include <test/util/mining.h> #include <test/util/script.h> #include <test/util/setup_common.h> @@ -45,5 +46,18 @@ static void AssembleBlock(benchmark::Bench& bench) PrepareBlock(test_setup->m_node, P2WSH_OP_TRUE); }); } +static void BlockAssemblerAddPackageTxns(benchmark::Bench& bench) +{ + FastRandomContext det_rand{true}; + auto testing_setup{MakeNoLogFileContext<TestChain100Setup>()}; + testing_setup->PopulateMempool(det_rand, /*num_transactions=*/1000, /*submit=*/true); + node::BlockAssembler::Options assembler_options; + assembler_options.test_block_validity = false; + + bench.run([&] { + PrepareBlock(testing_setup->m_node, P2WSH_OP_TRUE, assembler_options); + }); +} BENCHMARK(AssembleBlock, benchmark::PriorityLevel::HIGH); +BENCHMARK(BlockAssemblerAddPackageTxns, benchmark::PriorityLevel::LOW); |