txgraph: make number of acceptable iterations configurable (feature)

This commit is contained in:
Pieter Wuille
2025-04-13 11:16:26 -04:00
parent cfe9958852
commit e96b00d99e
5 changed files with 26 additions and 12 deletions

View File

@@ -46,6 +46,9 @@ void BenchTxGraphTrim(benchmark::Bench& bench)
static constexpr int NUM_DEPS_PER_BOTTOM_TX = 100;
/** Set a very large cluster size limit so that only the count limit is triggered. */
static constexpr int32_t MAX_CLUSTER_SIZE = 100'000 * 100;
/** Set a very high number for acceptable iterations, so that we certainly benchmark optimal
* linearization. */
static constexpr uint64_t NUM_ACCEPTABLE_ITERS = 100'000'000;
/** Refs to all top transactions. */
std::vector<TxGraph::Ref> top_refs;
@@ -57,7 +60,7 @@ void BenchTxGraphTrim(benchmark::Bench& bench)
std::vector<size_t> top_components;
InsecureRandomContext rng(11);
auto graph = MakeTxGraph(MAX_CLUSTER_COUNT, MAX_CLUSTER_SIZE);
auto graph = MakeTxGraph(MAX_CLUSTER_COUNT, MAX_CLUSTER_SIZE, NUM_ACCEPTABLE_ITERS);
// Construct the top chains.
for (int chain = 0; chain < NUM_TOP_CHAINS; ++chain) {