Skip to content

Fix perf issue for InstallAnotherVersionAction - #136992

Merged
Sandeep Somavarapu (sandy081) merged 5 commits into
microsoft:mainfrom
TwitchBronBron:faster-extension-version-picker
Jan 18, 2022
Merged

Sandeep Somavarapu (sandy081) merged 5 commits into
microsoft:mainfrom
TwitchBronBron:faster-extension-version-picker

Conversation

@TwitchBronBron

@TwitchBronBron Bronley Plumb (TwitchBronBron) commented Nov 11, 2021 •

Copy link
Copy Markdown
Contributor

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

vscode

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(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about use p-map for control concurrently?

@TwitchBronBron Bronley Plumb (TwitchBronBron) Nov 29, 2021 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Axetroy (@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.

@TwitchBronBron

Copy link
Copy Markdown
Contributor Author

Sandeep Somavarapu (@sandy081) is there anything I can do to help keep this moving?

@sandy081

Copy link
Copy Markdown
Member

I will take a look at it and get back to you. Thanks.

@sandy081
Sandeep Somavarapu (sandy081) merged commit 66e97d1 into microsoft:main Jan 18, 2022
@TwitchBronBron
Bronley Plumb (TwitchBronBron) deleted the faster-extension-version-picker branch January 18, 2022 14:10
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Install Another Version... takes a really long time for the C# extension only

4 participants