mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 15:04:44 +01:00
[bench] BlockAssembler with mempool packages
The current BlockAssembler bench only tests on a mempool where all transactions have 0 ancestors or descendants, which does not exercise any of the package-handling logic in BlockAssembler
This commit is contained in:
parent
6ce265acf4
commit
04528054fc
1 changed files with 14 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
||||||
#include <bench/bench.h>
|
#include <bench/bench.h>
|
||||||
#include <consensus/validation.h>
|
#include <consensus/validation.h>
|
||||||
#include <crypto/sha256.h>
|
#include <crypto/sha256.h>
|
||||||
|
#include <node/miner.h>
|
||||||
#include <test/util/mining.h>
|
#include <test/util/mining.h>
|
||||||
#include <test/util/script.h>
|
#include <test/util/script.h>
|
||||||
#include <test/util/setup_common.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);
|
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(AssembleBlock, benchmark::PriorityLevel::HIGH);
|
||||||
|
BENCHMARK(BlockAssemblerAddPackageTxns, benchmark::PriorityLevel::LOW);
|
||||||
|
|
Loading…
Add table
Reference in a new issue