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

Lazy Loading and Deferring Extensions #234231

Closed
ackvf opened this issue Nov 19, 2024 · 2 comments
Closed

Lazy Loading and Deferring Extensions #234231

ackvf opened this issue Nov 19, 2024 · 2 comments
Assignees

Comments

@ackvf
Copy link

ackvf commented Nov 19, 2024

Feature Request

Description:
Not only as a developer for active development work, but also to solve particular problem at hand, I often add numerous extensions to Visual Studio Code to enhance my workflow. However, these extensions can significantly slow down the startup time, especially when many of them are not related to the type of work being done. For example, JavaScript extensions in a Python project or vice versa. While the "disable for workspace" feature helps, it doesn't address situations where VSCode is loaded without a workspace on an ad-hoc file. Then there are extensions which don't necessarily make sense in any development work whatsoever, but they are instead meant to make tedious manual work easier - batch rename files, batch visual search&replace editor, Markdown editing, CSV editing, Excel viewer, drawing diagrams, Jupyter notebooks, ... just to name a few.

Proposal:
Introduce a lazy loading mechanism for extensions in Visual Studio Code. This feature would allow extensions to load only when they are needed, improving startup performance and reducing unnecessary resource usage.

Key Features:

  1. Load on File Type:

    • Extensions related to a specific language (e.g., JavaScript, Python) could load only when a file of that type is opened for the first time.
      • This can either be configured by the extension developer or by user in their settings.
  2. Load on Command Execution:

    • Extensions could load only when a command provided by the extension is executed for the first time.
  3. Deferred Loading:

    • Another option could be to allow users to defer the loading of any extension for a specified number of seconds after startup.
    • Or to specify the priority with which the extension is loaded to ensure the IDE remains responsive.
  4. API Availability:

    • For this to work, extensions would need to expose their API (e.g., commands, keyboard shortcuts), for seamless IDE integration, but only load lazily after a feature is used for the first time.

Benefits:

  • Improved Startup Performance: By loading extensions only when needed, the startup time of Visual Studio Code can be significantly reduced.
  • Resource Efficiency: Reduces unnecessary resource usage by not loading extensions that are not relevant to the current work.
  • Enhanced User Experience: Ensures that the IDE remains responsive and does not hang due to the loading of multiple extensions.

Note: As English is not my first language, I did have ChatGPT help me rewrite my proposal in a more understandable and appealing way, but all the thoughts here are mine. I hope this doesn't offend you.

#46846 #164068

@joshspicer
Copy link
Member

Thanks for the feedback. Extensions are loaded based on the activation events declared by the extension authors. Ensuring extensions are loaded in an efficient way is in part the reponsibility of the author.

You could also consider installing slower extensions exclusively in just the workspaces that need it. In this case you could the keep your "Defaults" to only the essentials, improving your experience.

Hope these help, let us know if you have any other feedback!

@joshspicer joshspicer closed this as not planned Won't fix, can't repro, duplicate, stale Nov 21, 2024
@ackvf
Copy link
Author

ackvf commented Nov 21, 2024

You could also consider installing slower extensions exclusively in just the workspaces that need it. In this case you could the keep your "Defaults" to only the essentials, improving your experience.

Hope these help, let us know if you have any other feedback!

I feel stupid for not having thought about that. Thank you!

I will install all extensions that I need, so that I can keep track of them, but I will keep them disabled and only enable them per workspace.

@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Jan 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants