mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-02 09:46:14 +00:00
clusterlin: count chunk deps without loop (optimization)
This small optimization avoids the need to loop over the parents of each transaction when initializing the dependency-counting structures inside GetLinearization().
This commit is contained in:
parent
f66fa69ce0
commit
d69c9f56ea
@ -1291,10 +1291,8 @@ public:
|
||||
tx_deps[chl_idx] = chl_data.parents.Count();
|
||||
auto chl_chunk_rep = chl_data.chunk_rep;
|
||||
chunk_reps.Set(chl_chunk_rep);
|
||||
for (auto par_idx : chl_data.parents) {
|
||||
auto par_chunk_rep = m_tx_data[par_idx].chunk_rep;
|
||||
chunk_deps[chl_chunk_rep] += (par_chunk_rep != chl_chunk_rep);
|
||||
}
|
||||
const auto& chl_chunk_txn = m_tx_data[chl_chunk_rep].chunk_setinfo.transactions;
|
||||
chunk_deps[chl_chunk_rep] += (chl_data.parents - chl_chunk_txn).Count();
|
||||
}
|
||||
/** Function to compute the highest element of a chunk, by fallback_order. */
|
||||
auto max_fallback_fn = [&](TxIdx chunk_rep) noexcept {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user