Skip to content

Avoid blocking main thread when a folder is opened #198384

@karrtikr

Description

@karrtikr

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

Metadata

Metadata

Labels

extension-hostExtension host issuesextensionsIssues concerning extensionsfreeze-slow-crash-leakVS Code crashing, performance, freeze and memory leak issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions