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

Add concurrent helpers to Async/RemoteSparseIndex #11

Merged
merged 4 commits into from
Aug 4, 2023

Conversation

Jake-Shadle
Copy link
Member

  • Update gix
  • Add concurrent/parallel helpers
  • Ship parsing/disk ops to threadpool

This came up during rustsec/rustsec#923, but it is often more efficient to send many concurrent requests with an async runtime than to use the blocking reqwest client with a threadpool eg rayon. This just adds krates helpers to request many crates concurrently for both the blocking and async implementations so that end users don't have to do it themselves.

When requesting eg. several hundred crates, it's _generally_ more
efficient to emit many concurrent requests, particularly on low core
count machines
@Jake-Shadle
Copy link
Member Author

Note that in the case of rayon/crossbeam-channel, this only adds to dependencies if gix is not brought in, which feels reasonable rather than having additional feature flags.

@Jake-Shadle Jake-Shadle merged commit 5113fc0 into main Aug 4, 2023
@Jake-Shadle Jake-Shadle deleted the sparse-parallel branch August 4, 2023 11:53
@Shnatsel
Copy link
Contributor

Shnatsel commented Aug 4, 2023

Does the multi-threaded Tokio executor measurably help? I'd expect the single-threaded one to be more than enough in this case. The multi-threaded runtime is more useful for high-load web servers.

@Jake-Shadle
Copy link
Member Author

Uhh, didn't actually check that at all, sorry.

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