microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.05k stars 28.8k forks source link

Open file through cli locally is significantly slower than from remote #213610

Closed Legend-Master closed 2 months ago

Legend-Master commented 4 months ago

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

Version: 1.89.1 (user setup)
Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685
Date: 2024-05-07T05:13:33.891Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Windows_NT x64 10.0.19045

Steps to Reproduce:

  1. Open a file from Windows File Explorer or from terminal with code <file>
  2. Compare to opening a file in the terminal of a remote session with remote extensions like wsl or remote ssh

Open file through cli locally is significantly slower than from remote extensions like wsl and remote ssh

https://github.com/microsoft/vscode/assets/68118705/35208c44-756e-4c22-bea7-e6340b10e8d2

https://github.com/microsoft/vscode/assets/68118705/a40e729f-b31a-47da-a83f-e3fba4cc90af

bpasero commented 4 months ago

What you see is expected simply because in the local case an entire Code.exe needs to be launched which is a lot more compared to in remote where we just load a small script.

In order to address this we would have to ship a CLI tool that can do opening of files instantly without having to start Code.exe first.

//cc @connor4312

VSCodeTriageBot commented 4 months ago

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

Legend-Master commented 4 months ago

I think the problem is not really running Code.exe is too slow, if I type other commands like code --version, it's not that slow never mind, code cli will redirect open file to Code.exe

This is more of a performance enhancement request than a feature request to be honest...

Legend-Master commented 4 months ago

If I understand correctly, we run a single instance of vscode at a time, all subsequent instances will send the information to the first instance, let the first instance handle it and terminates itself, in that case is it possible we make that part of the code run even earlier so that we don't waste time on initializing other things?

This is something quite annoying when I want to use vscode to open a file from file explorer, I need to wait a bit for it to open and it's even slower than using PowerToys's Peek which is also vscode (monoco editor)...

connor4312 commented 4 months ago

In order to address this we would have to ship a CLI tool that can do opening of files instantly without having to start Code.exe first.

We can eventually make the Rust CLI the primary entrypoint, though for this particular case we'd have to share contract with the CLI so that it can do the appropriate messaging to make the open file request.

VSCodeTriageBot commented 2 months ago

This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

vs-code-engineering[bot] commented 2 months ago

:slightly_frowning_face: In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our documentation.

Happy Coding!