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

Avoid blocking main thread when a folder is opened #198384

Closed
1 of 3 tasks
karrtikr opened this issue Nov 16, 2023 · 3 comments
Closed
1 of 3 tasks

Avoid blocking main thread when a folder is opened #198384

karrtikr opened this issue Nov 16, 2023 · 3 comments
Assignees
Labels
extension-host Extension host issues extensions Issues concerning extensions freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues

Comments

@karrtikr
Copy link
Contributor

karrtikr commented Nov 16, 2023

Does this issue occur when all extensions are disabled?: Yes

Version: 1.85.0-insider (user setup)
OS: Windows_NT x64 10.0.22518

These things block main thread significantly when starting up, following observations correspond to this CPU profile, but can be reproduced almost consistently:

  • Git extension uses spawn to "get the repository root" which can block over 3 seconds:

image

Note spawn in NodeJS is known to be synchronous and blocking: microsoft/vscode-python#22146 (comment). We can use worker threads here to spawn in a different thread, we've been doing the same in Python extension when spawning other binaries: microsoft/vscode-python#22146

  • WSL recommender extension "gets telemetry" using "readFileSync" in the process, probably not necessary.

image

  • This is probably required but extension host seems to use readFileSync which blocks some time:

image
image

@bpasero bpasero assigned lszomoru, alexdima and aeschli and unassigned bpasero Nov 16, 2023
@bpasero bpasero added freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues extensions Issues concerning extensions extension-host Extension host issues and removed triage-needed labels Nov 16, 2023
@karrtikr karrtikr changed the title Improve startup performance when a folder is opened Avoid blocking main thread when a folder is opened Nov 16, 2023
@lszomoru
Copy link
Member

The Git extension uses spawn for every git operation. If there is a better way of doing things (ex: use workers) then we should explore doing that as it would have significant impact. I will look into this in December.

@aeschli
Copy link
Contributor

aeschli commented Nov 17, 2023

I removed the WSL recommender extension: We no longer use it: #198502

@aeschli aeschli removed their assignment Nov 17, 2023
@lszomoru
Copy link
Member

lszomoru commented Dec 6, 2023

Spoke with @deepak1556 and the issue seems to be specific to @karrtikr's environment with more details here - microsoft/vscode-python#22146. There is no need to any changes in VS Code so I am closing this issue.

@lszomoru lszomoru closed this as not planned Won't fix, can't repro, duplicate, stale Dec 6, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
extension-host Extension host issues extensions Issues concerning extensions freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues
Projects
None yet
Development

No branches or pull requests

6 participants