mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 23:29:12 +01:00
clusterlin: replace cluster linearization with SFL (feature)
This replaces the existing LIMO linearization algorithm (which internally uses ancestor set finding and candidate set finding) with the much more performant spanning-forest linearization algorithm. This removes the old candidate-set search algorithm, and several of its tests, benchmarks, and needed utility code. The worst case time per cost is similar to the previous algorithm, so ACCEPTABLE_ITERS is unchanged.
This commit is contained in:
@@ -2091,9 +2091,9 @@ std::pair<uint64_t, bool> GenericClusterImpl::Relinearize(TxGraphImpl& graph, in
|
||||
// Invoke the actual linearization algorithm (passing in the existing one).
|
||||
uint64_t rng_seed = graph.m_rng.rand64();
|
||||
auto [linearization, optimal, cost] = Linearize(m_depgraph, max_iters, rng_seed, m_linearization);
|
||||
// Postlinearize if the result isn't optimal already. This guarantees (among other things)
|
||||
// that the chunks of the resulting linearization are all connected.
|
||||
if (!optimal) PostLinearize(m_depgraph, linearization);
|
||||
// Postlinearize to guarantee that the chunks of the resulting linearization are all connected.
|
||||
// (SFL currently does not guarantee connected chunks even when optimal).
|
||||
PostLinearize(m_depgraph, linearization);
|
||||
// Update the linearization.
|
||||
m_linearization = std::move(linearization);
|
||||
// Update the Cluster's quality.
|
||||
|
||||
Reference in New Issue
Block a user