Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the first of two PRs that remove the need to load the full index for many operations.
The idea is that we know what indexes are configured, where they are on disk, and where each crate lives therein, so any time a crate is needed, we can load it at that time. All in all, this should speed-up things when indexes grow, and fewer external detections should be attempted.
There is a catch that makes this not as straightforward as it seems, which is that "provides" fields mean that a provided crate may require loading whichever other crates provide it, and this is unknown in advance until the whole index has been loaded at least once.
This part is what goes into the follow-up PR: the first time we "see" an index, it is loaded in full and
provider -> provided
mappings are stored in a new metadata file that is invalidated whenever indexes are added or updated. From then on, we know all the crates that must be loaded when one is requested, and lazy load works as intended in all cases.Fixes #910, fixes #381