Fix perf issue for InstallAnotherVersionAction#136992
Merged
sandy081 merged 5 commits intomicrosoft:mainfrom Jan 18, 2022
TwitchBronBron:faster-extension-version-picker
Merged
Fix perf issue for InstallAnotherVersionAction#136992sandy081 merged 5 commits intomicrosoft:mainfrom TwitchBronBron:faster-extension-version-picker
sandy081 merged 5 commits intomicrosoft:mainfrom
TwitchBronBron:faster-extension-version-picker
Conversation
iObject
approved these changes
Nov 16, 2021
axetroy
reviewed
Nov 28, 2021
| return result; | ||
| const seenVersions = new Set<string>(); | ||
| // Run checks in parallel to reduce wait time (fixes slow performance related to extensions with ownership changes) | ||
| const result = await Promise.all( |
Contributor
Author
There was a problem hiding this comment.
@axetroy I'm a new contributor to vscode. What's vscode's policy on adding more npm packages? I'd be happy to add this if it's a normal thing to do, as that does look like a nice package that will help manage the number of "concurrent" threads.
Contributor
Author
|
@sandy081 is there anything I can do to help keep this moving? |
Member
|
I will take a look at it and get back to you. Thanks. |
sandy081
approved these changes
Jan 18, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 PR fixes #140525
There's a significant performance issue with the "Install another version" dropdown in the extensions panel, but it only affects extensions that have undergone an ownership change. For example, this extension that I maintain used to be published under the publisher name "celsoaf", but is now published under the publisher name "rokucommunity". (I worked with vsmarketplace team to migrate the extension to a new publisher name without losing all our stats and information).
The issue is caused by certain artifacts on the server no longer existing (or using the wrong URLs, not sure which), resulting in very slow (300-500ms) 403 and 404 http responses from the server. This drastically slows down the process of gathering all version information since that process is run sequentially here. Ideally the vsmarketplace team could speed up their 403 and 404 error response times or include additional version metadata so vscode doesn't need to run an HTTP query for every version. However, I have created a fix that seems to work around the issue.
To mitigate the performance issues, rather than running the queries one at a time, we instead run them all at the same time. Consider the results:
Before my fix: 57 seconds
After my fix: 1 second