Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: use futures unordered for active requests #4231

Merged
merged 3 commits into from
Aug 16, 2023

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented Aug 16, 2023

replace vec of futures with futures unordered

🤖 Generated by Copilot at 7126599

Improved network transaction requests and added documentation in reth crate. The changes use FuturesUnordered and a custom Future to handle multiple requests concurrently and handle errors gracefully. The new code is documented with comments and docstrings in crates/net/network/src/transactions.rs.

@mattsse mattsse requested a review from Rjected as a code owner August 16, 2023 15:03
@codecov
Copy link

codecov bot commented Aug 16, 2023

Codecov Report

Merging #4231 (e7f2f01) into main (d643d03) will decrease coverage by 0.02%.
Report is 5 commits behind head on main.
The diff coverage is 4.16%.

Impacted file tree graph

Files Changed Coverage Δ
crates/net/network/src/transactions.rs 60.02% <4.16%> (-1.12%) ⬇️

... and 22 files with indirect coverage changes

Flag Coverage Δ
integration-tests 16.82% <0.00%> (-0.03%) ⬇️
unit-tests 64.10% <4.16%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
reth binary 26.13% <ø> (-0.01%) ⬇️
blockchain tree 82.56% <ø> (ø)
pipeline 90.07% <ø> (ø)
storage (db) 74.73% <ø> (-0.06%) ⬇️
trie 94.71% <ø> (ø)
txpool 51.07% <ø> (ø)
networking 77.51% <4.16%> (-0.22%) ⬇️
rpc 58.63% <ø> (-0.02%) ⬇️
consensus 63.53% <ø> (ø)
revm 32.15% <ø> (ø)
payload builder 6.82% <ø> (ø)
primitives 87.93% <ø> (+0.06%) ⬆️

@mattsse mattsse added the C-perf A change motivated by improving speed, memory usage or disk footprint label Aug 16, 2023
Copy link
Member

@Rjected Rjected left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -575,27 +575,23 @@ where

// Advance all requests.
// We remove each request one by one and add them back.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: comment is not accurate now

@mattsse mattsse enabled auto-merge August 16, 2023 17:52
@mattsse mattsse added this pull request to the merge queue Aug 16, 2023
Merged via the queue into main with commit 1fda268 Aug 16, 2023
24 checks passed
@mattsse mattsse deleted the matt/use-futures-unordered branch August 16, 2023 18:13
alessandromazza98 pushed a commit to alessandromazza98/reth that referenced this pull request Aug 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-perf A change motivated by improving speed, memory usage or disk footprint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants