8 #include <cluster_linearize.h> 18 template<
typename SetType>
33 template<
typename SetType>
46 template<
typename SetType>
73 }
else if ((i & 1) == 0) {
114 template<
typename SetType>
117 const auto depgraph = MakeHardGraph<SetType>(ntx);
118 const auto iter_limit = std::min<uint64_t>(10000, uint64_t{1} << (ntx / 2 - 1));
119 uint64_t rng_seed = 0;
120 bench.batch(iter_limit).unit(
"iters").run([&] {
122 auto [candidate, iters_performed] = finder.FindCandidateSet(iter_limit, {});
123 assert(iters_performed == iter_limit);
140 template<
typename SetType>
143 const auto depgraph = MakeLinearGraph<SetType>(ntx);
144 uint64_t rng_seed = 0;
145 std::vector<ClusterIndex> old_lin(ntx);
148 Linearize(depgraph, 0, rng_seed++, old_lin);
160 template<
typename SetType>
163 const auto depgraph = MakeWideGraph<SetType>(ntx);
164 uint64_t rng_seed = 0;
165 std::vector<ClusterIndex> old_lin(ntx);
168 Linearize(depgraph, 0, rng_seed++, old_lin);
172 template<
typename SetType>
176 std::vector<ClusterIndex> lin(ntx);
183 template<
typename SetType>
191 std::vector<ClusterIndex> lin1;
192 std::vector<ClusterIndex> lin2;
197 lin2.push_back(ntx - i);
static void LinearizePerIter32TxWorstCase(benchmark::Bench &bench)
BENCHMARK(LinearizePerIter16TxWorstCase, benchmark::PriorityLevel::HIGH)
static void LinearizeNoIters64TxWorstCaseLIMO(benchmark::Bench &bench)
ClusterIndex AddTransaction(const FeeFrac &feefrac) noexcept
Add a new unconnected transaction to this transaction graph (at the end), and return its ClusterIndex...
static void MergeLinearizations48TxWorstCase(benchmark::Bench &bench)
static void LinearizeNoIters99TxWorstCaseAnc(benchmark::Bench &bench)
uint32_t ClusterIndex
Data type to represent transaction indices in clusters.
static void PostLinearize16TxWorstCase(benchmark::Bench &bench)
static void LinearizeNoIters32TxWorstCaseLIMO(benchmark::Bench &bench)
static void LinearizePerIter64TxWorstCase(benchmark::Bench &bench)
static void LinearizePerIter75TxWorstCase(benchmark::Bench &bench)
static void PostLinearize75TxWorstCase(benchmark::Bench &bench)
static void MergeLinearizations99TxWorstCase(benchmark::Bench &bench)
static void LinearizeNoIters48TxWorstCaseAnc(benchmark::Bench &bench)
static void MergeLinearizations75TxWorstCase(benchmark::Bench &bench)
static void LinearizeNoIters75TxWorstCaseLIMO(benchmark::Bench &bench)
static void LinearizePerIter16TxWorstCase(benchmark::Bench &bench)
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
static void PostLinearize64TxWorstCase(benchmark::Bench &bench)
static void LinearizeNoIters48TxWorstCaseLIMO(benchmark::Bench &bench)
static void LinearizePerIter99TxWorstCase(benchmark::Bench &bench)
static void PostLinearize32TxWorstCase(benchmark::Bench &bench)
static void LinearizeNoIters16TxWorstCaseLIMO(benchmark::Bench &bench)
static void LinearizeNoIters75TxWorstCaseAnc(benchmark::Bench &bench)
static void MergeLinearizations16TxWorstCase(benchmark::Bench &bench)
static void MergeLinearizations32TxWorstCase(benchmark::Bench &bench)
static void PostLinearize48TxWorstCase(benchmark::Bench &bench)
void AddDependency(ClusterIndex parent, ClusterIndex child) noexcept
Modify this transaction graph, adding a dependency between a specified parent and child...
static void MergeLinearizations64TxWorstCase(benchmark::Bench &bench)
Data structure that holds a transaction graph's preprocessed data (fee, size, ancestors, descendants).
std::pair< std::vector< ClusterIndex >, bool > Linearize(const DepGraph< SetType > &depgraph, uint64_t max_iterations, uint64_t rng_seed, Span< const ClusterIndex > old_linearization={}) noexcept
Find or improve a linearization for a cluster.
static void LinearizeNoIters16TxWorstCaseAnc(benchmark::Bench &bench)
Main entry point to nanobench's benchmarking facility.
std::vector< ClusterIndex > MergeLinearizations(const DepGraph< SetType > &depgraph, Span< const ClusterIndex > lin1, Span< const ClusterIndex > lin2)
Merge two linearizations for the same cluster into one that is as good as both.
void PostLinearize(const DepGraph< SetType > &depgraph, Span< ClusterIndex > linearization)
Improve a given linearization.
static void LinearizeNoIters32TxWorstCaseAnc(benchmark::Bench &bench)
static void PostLinearize99TxWorstCase(benchmark::Bench &bench)
Class encapsulating the state needed to perform search for good candidate sets.
static void LinearizePerIter48TxWorstCase(benchmark::Bench &bench)
static void LinearizeNoIters99TxWorstCaseLIMO(benchmark::Bench &bench)
static void LinearizeNoIters64TxWorstCaseAnc(benchmark::Bench &bench)