Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix perf issue for InstallAnotherVersionAction #136992

Merged
merged 5 commits into from
Jan 18, 2022
Merged

Fix perf issue for InstallAnotherVersionAction #136992

merged 5 commits into from
Jan 18, 2022

Conversation

TwitchBronBron
Copy link
Contributor

@TwitchBronBron TwitchBronBron commented Nov 11, 2021

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
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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@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
Contributor Author

@sandy081 is there anything I can do to help keep this moving?

@sandy081 sandy081 modified the milestones: November 2021, January 2022 Dec 15, 2021
@sandy081
Copy link
Member

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

@sandy081 sandy081 merged commit 66e97d1 into microsoft:main Jan 18, 2022
@TwitchBronBron 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