Vim icon indicating copy to clipboard operation
Vim copied to clipboard

Vim gets very slow, the longer VSCode seems to be open

Open RononDex opened this issue 4 years ago • 76 comments

Describe the bug Since a few days / weeks vim has become incredibly slow for me, and it gets worse the longer vscode is open. Any mode change takes around 1s when vscode is open for 1h or so, and around 2s when its open 2h or so. This also includes using easymotion

To Reproduce Steps to reproduce the behavior:

  1. Keep vscode open for some time (and do some work)
  2. vim gets slower and slower as time progresses
  3. restart of vscode makes it fast again

Expected behavior Performance does not degrade with time

Environment (please complete the following information):

Extension version: 1.9.0 VS Code version: Code 1.36.1 (2213894ea0415ee8c85c5eea0d0ff81ecc191529, 2019-07-08T22:59:35.033Z) OS version: Windows_NT x64 10.0.16299

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz (12 x 3696)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.87GB (11.71GB free)
Process Argv
Screen Reader no
VM 0%

RononDex avatar Aug 06 '19 08:08 RononDex

UPDATE: I figured out what causes it to get slow. If I disable "vim.statusBarColorControl": false,, it gets fast again

So updating the status bar is what takes so long

RononDex avatar Aug 06 '19 09:08 RononDex

I'm still having this issue.

"vim.statusBarColorControl" isn't enabled for me and it's lagging.

ctrl-alt-adrian avatar Aug 13 '19 21:08 ctrl-alt-adrian

Also getting a similar issue (really bad lag in INSERT mode, doesn't really have any rhyme or reason to it) and I also have vim.statusBarColorControl disables. Also doesn't get fixed on restart, still seems to persist.

renodubois avatar Aug 19 '19 19:08 renodubois

I'm having this issue as well, and i dont have vim.statusBarColorControl enabled. So i'm hoping to see a fix to this soon, primarily while switching from normal to insert mode can take up to a minute switching modes.

danditomaso avatar Aug 20 '19 20:08 danditomaso

I'm having this issue as well, and i dont have vim.statusBarColorControl enabled. So i'm hoping to see a fix to this soon, primarily while switching from normal to insert mode can take up to a minute switching modes.

Yeah. I notice the typing slows down a lot. Its like it's in a bottleneck and I have to wait for Vim to catch up to what I typed.

ctrl-alt-adrian avatar Aug 21 '19 10:08 ctrl-alt-adrian

Wanted to bump and see if anyone had found a fix for this - it's caused me to disable the Vim extension a few times now, since switching between insert and normal mode takes so long.

renodubois avatar Aug 27 '19 18:08 renodubois

I haven't actually had Vim Code Vim slow down over time, but I have it slow down when I open a large file. If you are seeing slow down on vim operations, maybe try using the profiling tool in the Developer tools and figure out what causes it?

stevenguh avatar Sep 02 '19 16:09 stevenguh

I'm seeing a similar issue. For me, when I press J or K for like a second the cursor afterwards is still catching up while in normal mode.

This is especially bad if the explorer sidebar is open. If I hide it, the performance gets better. I have tried disabling the statusBarColorControl, but this did not change anything.

sebastianhoitz avatar Sep 25 '19 13:09 sebastianhoitz

Same issue. Currently the plugin is unusable for me.

contang0 avatar Nov 11 '19 13:11 contang0

Yea, my vim plugin has running really slow, for the past few versions of vscode. Curiously though, I have no problems with the vim plugin when using vscode insiders.

I'm curious if someone else having this issue can try enabling vim in vscode insiders to see if they have the same experience?

jakechiam avatar Nov 11 '19 14:11 jakechiam

I was blaming vscode for this but indeed seems like its the Vim plugin.

code-insiders doesn't make a difference for me.

AlexMenor avatar Nov 14 '19 09:11 AlexMenor

I'm seeing a similar issue. For me, when I press J or K for like a second the cursor afterwards is still catching up while in normal mode.

Same for me, I often overshoot my target code by a few lines because of that

velcroz avatar Nov 21 '19 08:11 velcroz

I'm seeing a similar issue. For me, when I press J or K for like a second the cursor afterwards is still catching up while in normal mode.

Same for me, I often overshoot my target code by a few lines because of that

I am getting the same issue.

mrjoedang avatar Nov 22 '19 14:11 mrjoedang

same experience here

rodrei avatar Nov 28 '19 19:11 rodrei

Same issue here, sometimes after a while, it causes any keyboard input to not be registered at all.

austinsantoso avatar Dec 14 '19 16:12 austinsantoso

same here, especially on insert mode.

thai-d-v avatar Dec 18 '19 14:12 thai-d-v

As a temporary workaround, I noticed when uninstalling it, then reinstalling it, it will work well again. This is temporary, but at least it works.

alex-cory avatar Dec 23 '19 15:12 alex-cory

Bumping this, Vim plugin getting unusable, slowdown is only happens in insert mode. Process Explorer points out that there is no high CPU usage, but my memory used for the open window doubles when it slows down.

Twiggeh avatar Feb 02 '20 21:02 Twiggeh

I don't see any performance issues while keeping it open. I have it open all day on two computers - Linux Mint 19.3 and Windows 10 (build 18363.628).

Some very old Windows 10 builds seem to struggle occasionally with Electron apps such as VS Code.

noslenac avatar Feb 03 '20 17:02 noslenac

I'm on mac Mojave and although I don't experience this issue all the time, it does happen from time to time and it's really annoying. I noticed it happening a lot when I was copying svg xml into JS files.

alex-cory avatar Feb 03 '20 22:02 alex-cory

I'm experiencing the same lag in motion. Honestly, this is one of the biggest things that makes me almost want to go back to just regular old vim!

pianocomposer321 avatar Feb 04 '20 23:02 pianocomposer321

Also in my case I experience a very annoying lag in motion. I am starting to seriously thinking to change editor just for this.

stefabat avatar Feb 09 '20 12:02 stefabat

@stefabat, you might want to try onivim. I can't wait until onivim 2 gets out, b/c it's going to support vscode extensions. But final release for that isn't until after June. :(

pianocomposer321 avatar Feb 10 '20 02:02 pianocomposer321

btw, I think my lag is because of enabling vim.foldFix. However, I really need to have the fix, so disabling it is not an option for me.

pianocomposer321 avatar Feb 10 '20 02:02 pianocomposer321

@pianocomposer321 onivim and onivim 2 look amazing, I did not know them. However, in the meantime I found an acceptable solution with this vscode extension: neo-vim. It is much faster than the vim extension, and has more or less everything I need.

stefabat avatar Feb 10 '20 08:02 stefabat

I have tried the extension too (in fact, I uninstalled the vscodevim extension in favor of it), and I agree that performance-wise it is much better. However, it has the same problem that enabling vim.foldFix solved with vscodevim, which is that it opens folds when moving the cursor over them. Several issues have been opened about this, but I don't think there is currently a fix in the works. Incidentally, I believe enabling vim.foldFix is also what caused the lag on vscodevim.

pianocomposer321 avatar Feb 11 '20 00:02 pianocomposer321

Also running into this problem, with serious lag between my typing and the characters appearing on the screen. I am using the latest version of MacOS (10.15.3), VSCode (1.42.0) and the VIM extension (1.12.4). I don't notice any difference with intellisense being triggered or not. I also notice no difference between editing a large file or a small file (I could easily reproduce my issue in a brand new file).

Just to ensure that other extensions were not getting in the way, I booted up VSCode with a fresh copy of the ~/.vscode directly and only installed the VIM extension. Still getting the issue.

I am sadly forced to disable this extension now because of how much this issue is getting in the way of me being able to write code. I doubt this is something that this extensions maintainers and community desire for :(

ecbrodie avatar Feb 12 '20 05:02 ecbrodie

Just out of curiosity, how many of you who are experiencing the lag have enabled vim.foldFix?

pianocomposer321 avatar Feb 12 '20 18:02 pianocomposer321

I don't have foldFix enabled

On Wed, Feb 12, 2020, 19:26 pianocomposer321 [email protected] wrote:

Just out of curiosity, how many of you who are experiencing the lag have enabled vim.foldFix?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/VSCodeVim/Vim/issues/3957?email_source=notifications&email_token=ABYVYUZFCSPMNEFOWNC7VBTRCQ5ODA5CNFSM4IJT4W42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELR3V5Y#issuecomment-585349879, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABYVYU3XSHPL5H5ZEFKMBJTRCQ5ODANCNFSM4IJT4W4Q .

mattydebie avatar Feb 12 '20 18:02 mattydebie

vim.foldFix does not even appear to be a valid extension, according to the list of available settings in my VSCode installation.

ecbrodie avatar Feb 15 '20 22:02 ecbrodie