Improve slow searches involving installed items #5701
Merged
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.
Fixes #5629
(and probably quite a few more list/upgrade some-query-provided performance related issues)
While things could still be made better, the good case (where files were already cached locally) of the previous behavior trying to complete
winget list Micro
was taking 51 seconds. With this change, it takes 6 seconds on the debug build. Given that there is intentionally little to no I/O and much of the CPU time is likely spent in our code, that should speed up more with the release.Issue
The indexed
IPackage
implementation for v2 needed to acquire the intermediate manifest to provide the response forGetVersionKeys
. Since this is used extensively to perform correlation between available packages and local items during a search, any available packages found by the query would then result in a download/disk read of the intermediate manifest.Change
Introduces
IPackage::GetMultiProperty
, allowing code that just wanted to get all of these values across all versions to do so more efficiently. For the v2 index, this is how the data is already stored in the database. For the otherIPackage
implementations, the data was also present and is just aggregated from each version's output.Validation
Added test for calling new interface function.
Added validation across
CompositeSource
tests to ensure that the functions known to need non-indexed data are not called.Microsoft Reviewers: Open in CodeFlow