mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-29 18:05:58 +02:00
clusterlin: permit passing in existing linearization to Linearize
This implements the LIMO algorithm for linearizing by improving an existing linearization. See https://delvingbitcoin.org/t/limo-combining-the-best-parts-of-linearization-search-and-merging for details.
This commit is contained in:
@@ -109,7 +109,7 @@ void BenchLinearizePerIterWorstCase(ClusterIndex ntx, benchmark::Bench& bench)
|
||||
});
|
||||
}
|
||||
|
||||
/** Benchmark for linearization of a trivial linear graph using just ancestor sort.
|
||||
/** Benchmark for linearization improvement of a trivial linear graph using just ancestor sort.
|
||||
*
|
||||
* Its goal is measuring how much time linearization may take without any search iterations.
|
||||
*
|
||||
@@ -124,8 +124,10 @@ void BenchLinearizeNoItersWorstCase(ClusterIndex ntx, benchmark::Bench& bench)
|
||||
{
|
||||
const auto depgraph = MakeLinearGraph<SetType>(ntx);
|
||||
uint64_t rng_seed = 0;
|
||||
std::vector<ClusterIndex> old_lin(ntx);
|
||||
for (ClusterIndex i = 0; i < ntx; ++i) old_lin[i] = i;
|
||||
bench.run([&] {
|
||||
Linearize(depgraph, /*max_iterations=*/0, rng_seed++);
|
||||
Linearize(depgraph, /*max_iterations=*/0, rng_seed++, old_lin);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user