-
Notifications
You must be signed in to change notification settings - Fork 247
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
Improve piece downloading #3259
Conversation
f1cf24a
to
74fa35a
Compare
…pt it for future changes
…osest peers into a single algorithm
…of slow downloads
74fa35a
to
467238a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense overall but even after offline discussion it's hard to follow the logic. The comment for the changed function from piece_provider
seems to obsolete. Please, try to summarize the current algorithm there.
Cleaned up comment a bit. All crucial sections seem to have a comment describing what they do. |
There is some reafactoring here, but the primary goal is to accelerate
PieceProvider
.Previously it had somewhat optimized implementation for downloading from connected peers and non-optimized implementation for closest peers downloads.
This new implementation is actually a bit simpler and unifies both mechanisms under single uniform logic. It does so by querying closest peers to convert them into connected and continue from there.
Together with piece cache tweaks from my testing this helps with both peak and sustained downloading speed. I'll be looking into avoiding making requests to connected peers that are not able to serve pieces and generally to non-farmers, but that will be a separate PR.
Code contributor checklist: