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

Download pieces in batches for piece cache sync #3151

Merged
merged 1 commit into from
Oct 20, 2024

Conversation

nazar-pc
Copy link
Member

@nazar-pc nazar-pc commented Oct 19, 2024

One more thing remained, the thing users complained about: piece cache sync.

This implements batched downloads, but only for initial sync. I was lazy to do it for keep-up sync right now and keep-up sync is much less critical.

Hit another one of the sub-issues of rust-lang/rust#110338 that I don't think I hit before, so had to waste a bit of time and do some unfortunate allocations to make it compile.

A lot of changes here are simply due to code being offset to the right.

Code contributor checklist:

@nazar-pc nazar-pc force-pushed the batched-piece-cache-sync branch from 00ac3b2 to 52c5731 Compare October 19, 2024 17:58
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

Looks good, the comment being inconsistent with the constant isn’t a blocker

self.handlers.progress.call_simple(&progress);
}
}));
// Download two batches concurrently to make sure slow tail of one is compensated by another
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Download two batches concurrently to make sure slow tail of one is compensated by another
// Download four batches concurrently to make sure slow tail of one is compensated by another

@nazar-pc nazar-pc added this pull request to the merge queue Oct 20, 2024
Merged via the queue into main with commit 02b054d Oct 20, 2024
8 checks passed
@nazar-pc nazar-pc deleted the batched-piece-cache-sync branch October 20, 2024 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants