-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Vim plugin slows vscode down. #2021
Comments
I have noticed this lag too. It's subtle but definitely noticeable compared to plain vim, and even compared to the Visual Studio vim plugin. Some more info:
This is on Windows. It's possible this is a platform specific thing so it's worth mentioning. |
I've just tested this on a colleague's macbook and I think the lag is present there too. |
I can type only one character per 2 seconds after I enabled vim. What happened? |
Any fixes? |
@theprash That example is a little bit different. What people typically seem to mean about "lag" is latency, that's throughput. I'm not sure what would cause such extreme latency. I'll do some performance profiling this weekend. Maybe the main causes of slowdown are just accentuated for some users. |
I haven't quantified any of these suspicions but possible areas of improvement:
|
Definitely profile before chasing down any potential problems. I am 95% certain the problem lies in us doing updateView more than we have to. Problem is that even a single call to updateView is expensive and I don't believe there's a way to do VSCodeVim without calling it at least once :P |
So one major source of performance issues is caused by interacting with the system clipboard (I'm guessing that might be why Windows users seem to complain more about this?). It's at least a quarter of the time needed on my computer right now. This issue is accentuated by us making multiple calls to the Register object for a command like Could anybody getting immense performance issues try setting |
@johnfn @jpoon Also as an update, I don't think The majority of the time is spent in |
Is there any movement on this? VSCode with VSCodeVIM and vscode-go is unusably slow for me. I notice it's worse in _test.go files. Disabling either extension returns to a snappy performance, but the two together appear incompatible. |
Definitely this for me. I was unusable until I set this to false. And as you vimmers know, without this option life is very sad. |
@armoucar: My User Settings show that |
Sorry @saites, I was wrong there. My performance problem happens when this flag is set to true, only on Windows. |
@jpoon I am on Windows To follow-up on setting More observations:
|
@jpoon I use the plugin on Mac (at work) and Windows (at home, but not that much). Doing a little bit of test now on Windows, vim operations that would send to clipboard (when vim.useSystemClipboard: true) are really slow: d, c, x, dd, yy. I have no issues when on a OS X |
I think there's a couple causes of massive lag. The first is the system clipboard library we use. Another one is interactions with other extensions, especially extensions that do a lot of work. One design deficiency imo of the current extension system is that all the extensions run on one thread :/ |
Having really bad lag issues on OSX as well |
I found a workaround: The delay on the keyboard input is gone if you turn on Zen Mode. And I use the following lines in my User Settings:
|
@xiao-vincent No help, still lag for me. |
I'm not sure, but seems redo and undo actions quite fast. I think it's possible to take part of implementation of this actions to make others. Is it possible? For example hack like this: create fake action and redo it. |
I notice too this delay. I don't know if this is of any use, but in my case:
I've done those tests by holding the j or k keys down, in smaller and bigger files. |
I've been suffering this, to the point of thinking about returning to Spacemacs, but finally it improved by setting |
@Peluko According to the documentation this feature is set to off by default. Did you have it enabled? |
@acicovic I enabled it on purpose some weeks ago, but at the moment I switched from working on Windows to working on macOS, so I didn't relate this to the lag. |
For my case insert mode is fine, most jumps are relatively snappy, but line movements are awful on my laptop. I press |
In addition to my previous comment, VSCodes newest feature "Highlighted indent guides" further worsens the situation as it degrades Vim's performance. |
tried all the solutions here and still have issues with large files on macos and windows, usually using typescript. seems like theres no real fix to this and we just have to deal with it? fwiw, the lag does seem to reduce when having less extensions, but i need extensions :) |
I had the same problem in a 5k line file. |
I uninstalled those long time ago and still had the impact. |
I was troubleshooting this issue today and came across the neovim extension. So far it meets my needs well and doesn't have any of the same performance problems. I've used and loved this extension for a long time, but the performance issues have become intolerable. In case it helps someone else, here's the extension I'm using now: https://github.com/asvetliakov/vscode-neovim |
I'm trying out the neovim plugin now. Note that the extension requires neovim being installed, and configuring it is a lot different than the vscode extension. I don't want to derail this issue on vim vs neovim, but vscode vim has become extremely problematic for large projects. |
I even took a way different road and switched to https://marketplace.visualstudio.com/items?itemName=gregoire.dance which is mainly the kakoune keymap |
Observation: for me it helped to add some metal to the stack. After installing a dedicated GPU, the sluggishness of this plug-in disappeared in total. The problem is not a general one though: before installing the GPU, VSCode would be barely usable with VSCodeVim but fast otherwise, regardless of the VSCode hardware acceleration setting. |
For me it seems like the longer VSCode is open, the worse/slower/laggier it gets. I think for me it's tied to the VSCodeVim clipboard? (the main thing that gets sluggish for me is whenever I'm yanking/pasting. I don't know what the setting This likely isn't the main issue here but might be related to it. My hack/workaround is not a solution, but it might help others. If I run |
In my case, I changed "Render Whitespace" from "none" to "selection", changed "Cursor Style" from "Block" to "line", and changed "Cursor Smooth Cart Animation" from "true" to "false". By changing the setting like this, it is not perfect, but it is solved by slowing down. |
I'm getting desperate so I'll try anything. Neovim didn't work out, I had everything setup but had way too many issues with undo/redo and going from insert to normal mode. Your settings for anyone interested:
I feel like I'm just throwing paint at the wall at this point |
@jensbodal What extensions do you have installed? They are by far the most impactful factor. |
Introduction. I use a translation tool because I don't speak English. I'm sorry if the English is awkward. I was trying to find out more about this issue, and I found something surprising. In my case, I only suffered from this problem when I used vscodevim on my laptop (OS:win10). When I connected HHKB which my friend gave me as a present by bluetooth today, the problem did not occur even though I did not change anything in the setting. I usually use autohotkey and set up the cursor keys to do vim-like operations. When using HHKB, fn+hjkl is set to replace the cursor keys in the HHKB body. (The cursor keys are actually being typed.) In other words, when the cursor keys are used, no delay occurs, but I think that the phenomenon of delay occurs when various tools are used to simulate the cursor keys. I'm testing it in a variety of environments and will report back with the results. |
Since this expansion program was updated yesterday, there has been a tremendous increase in speed in my work environment. I usually vs code to work with the "wsl". My Thinkpad T420s laptop also uses setting sync, so it's the same VS Code environment, but there's no slow down in T420s. The operating system of the T420s is CentOS 8. Maybe the speed problem of WSL1 is the root cause? |
If you use Dart extension : Dart-Code/Dart-Code#2902
It works for me. |
It works fine, thanks! |
This improved it by quite a bit. Still not as fast as I'd like it to be, but it's only slightly slower than with all extensions turned off, so the rest is a vscode problem. |
If you're having performance issues with all other extensions disabled, I'd be curious about:
There are still ways we can be more efficient, but I think it's improved a lot gradually over the last handful of months. |
It's definitely faster than it was before. I remember it being nigh unusable at one point on certain projects, so I had to go back to Visual Studio. The code's in typescript, typically about 200-300 lines long. No super long strings or anything like that. The project is a fairly big Angular project -- probably a couple hundred files in just our code. I'd imagine the project size shouldn't have much of an effect outside of when autocomplete's invoked, though, right? Especially with the language service and all that turned off. |
Yeah the project size should mainly come play for autocomplete, though also for colorization, etc. |
|
I just swapped keyboards with a coworker before finally realizing that the vim plugin caused this. |
Is #4101 possibly related? Maybe something else that should be asynchronous has become synchronous? |
Hi, just started using the plugin and immediately stumbled upon the issue on a 140 line long C source file, having the built-in bracket pair colorizer and various "too-essential-to-disable" plugins. Take a look at the solution proposed here: microsoft/vscode#75627 (comment) |
the solution in the last comment didn't solve it for me unfortunately |
Unbelievable that this issue still persists to this day. |
I had the same issue. My current version of the plugin is
In my case, this definitely was because some of my installed VS code plugins were in conflict with the |
after trying to deal with this issue a few years ago, I just switched to amVim and never looked back (it's not so feature-rich, but it works for me). |
What improved it for me... Disabling indent guides Those helped the most but I also disabled statusBarColorControl |
If I turn vim plugin on (all other plugins off), vscode starts to lag. There is a noticeable delay (0.1 sec) on every keyboard input.
The text was updated successfully, but these errors were encountered: