filters crds values in parallel when responding to gossip pull-requests (#18877)

When responding to gossip pull-requests, filter_crds_values takes a lot of time
while holding onto read-lock:
https://github.com/solana-labs/solana/blob/f51d64868/gossip/src/crds_gossip_pull.rs#L509-L566

This commit will filter-crds-values in parallel using rayon thread-pools.
This commit is contained in:
behzad nouri
2021-07-26 17:13:11 +00:00
committed by GitHub
parent f51d648681
commit f1198fc6d5
5 changed files with 108 additions and 76 deletions

View File

@@ -505,7 +505,7 @@ fn network_run_pull(
.collect()
};
let transfered: Vec<_> = requests
.into_par_iter()
.into_iter()
.map(|(to, filters, caller_info)| {
let mut bytes: usize = 0;
let mut msgs: usize = 0;
@@ -527,8 +527,9 @@ fn network_run_pull(
let rsp = node
.gossip
.generate_pull_responses(
thread_pool,
&filters,
/*output_size_limit=*/ usize::MAX,
usize::MAX, // output_size_limit
now,
)
.into_iter()