VSCodeVim / Vim

:star: Vim for Visual Studio Code
http://aka.ms/vscodevim
MIT License
14.02k stars 1.32k forks source link

Improve performance within VSO/Github Code Spaces #4828

Open ryan-allen opened 4 years ago

ryan-allen commented 4 years ago

I have tried using this plugin within Visual Studio Online and the new Github CodeSpaces. Typing with this plugin disabled, the editor is very responsive in the browser. When enabled on VSO/Codespaces the responsiveness of typing and auto-completion is not usable.

I originally thought it was due to being in Australia, then I thought it was Omnisharp, but it appears to be this plug in!

This issue is the only thing preventing me from adopting Code Spaces full time. I hope you can fix it! <3

jkeech commented 4 years ago

@ryan-allen, are you connecting to the Codespaces from the browser or from VS Code on the desktop?

ryan-allen commented 4 years ago

@jkeech my bad! it's within the browser, using current version of new msft edge

ryan-allen commented 4 years ago

looking at the open websockets, when using vscode vim there is an additional socket open that is transfering a lot more data than the other 3 whenever a single keypress is made using the vscodevim plugin

jkeech commented 4 years ago

@ryan-allen, thanks for the extra info. If you get a chance, could you also try it in VS Code desktop connected to a Codespace and see if it still happens? The difference is that this extension is marked as a “UI” extension which means that it will run on the client side in Desktop, but the remote side in Web (almost all extensions run on the remote side in the web context, even those marked as UI extensions).

I’m not super familiar with how vscode-vim works, but if it’s doing a lot of things that interact with the renderer on the client side, particularly if those are blocking actions, then the latency from the client side key press to the remote side extension and then back to the client side before the change registers could be dramatic.

My theory is that this problem will not happen on the Desktop, which would indicate that it’s a problem when vscode-vim runs on the remote side with extra latency between the renderer and the extension. If that’s the case, the only fix I’m aware of (other than potentially changing how the extension works, which might not be feasible) would be to get this extension running in the web worker on the client side in the browser, which is only done for a very limited set of extensions today.

ryan-allen commented 4 years ago

@jkeech heyo! yep when using vscode locally connected to a codespace and having vscodevim installed locally there is no problems. what is entailed in getting the extension running within a web worker on the browser? is that something that microsoft have to approve on a per-extension basis?

J-Fields commented 4 years ago

Thanks for the input @jkeech! Could you clarify what you mean by "things that interact with the renderer on the client side"? I'm not too well-versed on the architecture of VSCode (and especially Codespaces).

jkeech commented 4 years ago

@bpasero, can you help explain what might be causing the perf issues with this extension running on the remote side in the web context?

bpasero commented 4 years ago

Maybe @alexdima or @jrieken can answer that. I think the challenge is that this extension is constantly monitoring keypresses in the editor and thus typing probably results in a lot of roundtrips.

ryan-allen commented 4 years ago

@bpasero that's what appears to be happening when inspecting websocket activity with the extension installed in github codespaces web editor, @jkeech are you able to allow extensions to run on the client instead of the server?

StevenClontz commented 4 years ago

Glad to see it's not just me. I'm new to the VSCode ecosystem by way of the Codespaces beta, but the Vim keybindings provided by this extension in that environment are unfortunately very slow and buggy (e.g. when navigating through text, the cursor is often "rolled back" to a previous position in a loop).

admk commented 4 years ago

I'd like to also mention that ctrl+{f,b,e,y} shortcuts do not work.

csaska commented 4 years ago

I'm not sure if this is the same issue, but this extension doesn't seem to function at all when running VS Code via code-server.

Installing this extension causes all keyboard clicks to have no effect when editing files.

Edit: Didn't work at all when code-server was run behind a reverse proxy. Works fine when running locally or connected to code-server via ssh forwarding