vim-plug icon indicating copy to clipboard operation
vim-plug copied to clipboard

PlugDiff much slower in vim compared to neovim (while PlugUpdate is equally fast).

Open jgb opened this issue 7 months ago • 7 comments

Hello,

I'm a vim user, and PlugUpdate works equally fast in vim compared to neovim, which is great. However PlugDiff is much slower in vim, by a factor of 8-9, as opposed to neovim where it is almost instantaneous.

Is this something that could be fixed? I'm using vim 9.1.1230, neovim 0.10.4 and git 2.47.2 on debian unstable, with the latest vim-plug. Vim is compiled with +python3 +ruby +vim9script.

Greetings,

jgb

jgb avatar May 12 '25 10:05 jgb

nvim goes brr

UltiRequiem avatar May 20 '25 23:05 UltiRequiem

However PlugDiff is much slower in vim, by a factor of 8-9, as opposed to neovim where it is almost instantaneous.

In my case, it is faster in Neovim, but it's not like by a factor of 8-9, but somewhere around 1.5 and 2.

let a = reltime() | PlugDiff | echom reltimestr(reltime(a))
  • Vim: 3.225016
  • Neovim: 1.912065

How long does it take on your system?

junegunn avatar May 21 '25 08:05 junegunn

@junegunn Hello,

tested it now:

  • neovim: 0.359486
  • vim: 0.521084
  • gvim: 5.622875

So it seems it's actually specific to gvim, not vim! The results are reproducible. Something must happen which is somehow very slow in gvim?

It's a pity because I drive gvim full time, not vim or neovim :)

Let me know if there's anything else I can try...

Greetings,

jgb

jgb avatar May 25 '25 09:05 jgb

Can you see a similar trend in this?

let a = reltime() | echom map(range(50), 'system("echo ".v:val)') | echom reltimestr(reltime(a))

junegunn avatar May 26 '25 06:05 junegunn

let a = reltime() | echom map(range(50), 'system("echo ".v:val)') | echom reltimestr(reltime(a))

  • neovim: 0.056979
  • vim: 0.192386
  • gvim: 2.608553

So yes it seems the trend is similar!

jgb avatar May 26 '25 07:05 jgb

Hm... It seems command prompt window cost. I think job API does not have the problem.

Shougo avatar May 26 '25 08:05 Shougo

I can also confirm it's definitely slower in MacVim. 3.3 seconds.

Thanks @Shougo for the comment. If you're right, we could write a custom system function that internally uses job API if available, and use it instead of the system.

junegunn avatar May 29 '25 09:05 junegunn