You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Change
This change has several performance improvements based on profiling.
### Installed package caching
A global process cache is stored for the unfiltered install data. It is
very basic for updates right now to make it more reasonable to service,
but future changes could improve things to examine the system data and
only do delta updates. It could also be saved to disk to improve the
performance of future processes.
The cache itself is not used by any callers, but instead in-memory
copies are handed out. The cache sets up event listeners for the current
data sources and waits for these events before it will attempt to update
again. A full cache hit requires only copying the memory database, which
SQLite has an efficient method for.
The only performance gain to the update path that is provided by this
implementation is to reuse the names of MSIX packages, but since this
accounts for a huge amount of creating the index it results in ~50% time
reduction in creating an updated installed source (without any MSIX
changes).
### ICU regex caching
The regular expressions that we use were being compiled repeatedly.
Since this is a fixed set of expressions, they are all now cached and
copies are used for actual operation.
### Version lookup (string)
The version lookup by string (such as `winget show FOO -v VER`) was
doing a full table scan. This change shifts to pulling all of the
version for the given identifier out and using `Version` object
comparisons to find the proper result. This has the side effect of
fixing a somewhat annoying user interaction where trailing 0s in a
version were still required to find from the command line. One can now
provide the smaller version string and still find the expected package
version (eg `1.2` will now find version `1.2.0`).
### Version lookup (available version)
The round trip from retrieving the available version information to
getting the manifest has been improved by including the manifest id
value directly in the available version data. The available version
package object now caches the version string to manifest id data as
well, meaning that any usage of a `PackageVersionKey` that was retrieved
from `GetAvailableVersions` will directly return the package version
object without querying the index.
### Let property lookups handle an unknown manifest id
The `GetProperty` code was enforcing that the manifest id was valid and
then reusing existing code that did not handle a missing manifest.
Creating new methods that can handle the missing manifest allows us to
remove the initial check.
0 commit comments