perf(trie): parallelize merge_ancestors_into_overlay extend ops (#21379)

This commit is contained in:
ethfanWilliam
2026-01-24 02:26:07 +04:00
committed by GitHub
parent ffbef9e3cd
commit d5a36dcc00

View File

@@ -284,8 +284,17 @@ impl DeferredTrieData {
}
// Extend with current block's sorted data last (takes precedence)
state_mut.extend_ref_and_sort(sorted_hashed_state);
nodes_mut.extend_ref_and_sort(sorted_trie_updates);
#[cfg(feature = "rayon")]
rayon::join(
|| state_mut.extend_ref_and_sort(sorted_hashed_state),
|| nodes_mut.extend_ref_and_sort(sorted_trie_updates),
);
#[cfg(not(feature = "rayon"))]
{
state_mut.extend_ref_and_sort(sorted_hashed_state);
nodes_mut.extend_ref_and_sort(sorted_trie_updates);
}
overlay
}