Make resolving related to windows registry faster#16697
Conversation
| resolvedEnv.source = uniq(resolvedEnv.source.concat(source ?? [])); | ||
| if (getOSType() === OSType.Windows && resolvedEnv.source?.includes(PythonEnvSource.WindowsRegistry)) { | ||
| // We can update env further using information we can get from the Windows registry. | ||
| await updateEnvUsingRegistry(resolvedEnv); |
There was a problem hiding this comment.
Weirdly, discovery actually got slower than before with #16642. It was because we were blocking resolving of all environments on getting registry interpreters, which effectively means all the locators are blocked on windows registry locator.
With this change we're only blocking resolving on registry for interpreters which were discovered via Windows registry.
There was a problem hiding this comment.
Do you have an estimate (% or ms) on how much faster it is now?
There was a problem hiding this comment.
Yes, it got approx. 30% faster with the promise caching and this.
| const interpreters = await getRegistryInterpreters(); | ||
| // Environment source has already been identified as windows registry, so we expect windows registry | ||
| // cache to already be populated. Call sync function which relies on cache. | ||
| let interpreters = getRegistryInterpretersSync(); |
There was a problem hiding this comment.
Having sync methods make updateEnvUsingRegistry finish faster as we do not yield control.
| /** | ||
| * Environment was found via conda binary or conda environments file | ||
| */ | ||
| Conda = 'conda', |
There was a problem hiding this comment.
Removed entries which were not being used anywhere.
Closes https://github.com/microsoft/vscode-python-internalbacklog/issues/315
#16697 (comment)