do plugins affect performance?

37 views
Skip to first unread message

meine

unread,
Jan 3, 2021, 7:10:04 AM1/3/21
to vim...@googlegroups.com
Hi,

Does anyone know if installed plugins affect the speed of Vim when they
are not used?

I don't use many plugins, but know that 'add ons' in other programs can
slow up the workings, even when not used.

TIA

//meine

gevisz

unread,
Jan 7, 2021, 12:34:05 PM1/7/21
to vim...@googlegroups.com
вс, 3 янв. 2021 г. в 14:09, meine <tria...@gmx.com>:
>
> Does anyone know if installed plugins affect the speed of Vim
> when they are not used?
>

It is not clear what you mean by "not used plugins".

If "not used" here means that these plugins are not loaded
into the memory while Vims starts, I cannot see any reason
why they should have any influence on its performance.

If, however, "not used" means that they are loaded into
the memory while Vim starts but eventually are not used
by the user, then of course they can affect its performance,
for example, by constantly checking if the user has not
entered a sequence of symbols that should be processed
by them.

Charles Campbell

unread,
Jan 7, 2021, 1:30:58 PM1/7/21
to vim...@googlegroups.com
I agree with gevisz: a plugin could have an impact on performance even
if not used. Just imagine that there's a busy wait loop that fires up
when the plugin is loaded -- it would just hog the machine (well, at
least a core).

Nonetheless, mostly what plugins do upon startup is:

  define functions
  define various mappings, commands

Vim, of course, does have to determine whether or not a given sequence
of symbols invokes a command, function, or mapping. There are a number
of ways to do this; some are log-m (m=qty characters in the string,
n=qty of strings), so adding in extra mappings, commands, and functions
should be negligible cost in time.

So, I would not expect unused plugins to exact a performance cost.

Regards,
Chip Campbell

Salman Halim

unread,
Jan 7, 2021, 1:49:40 PM1/7/21
to Vim Users
I was thinking the same thing: unless a plugin
has expensive autocommands that trigger often, but do nothing (CursorHold, for example), the only time performance hit should be upon initial startup when it's loaded.

It is possible that a plugin defines mappings with ambiguity and that introduces a timeout for Vim to figure out which mapping to use, but that delay isn't caused by the hardware not being able to keep up. I occasionally get mapping collisions in new plugins that conflict with unused plugins or unused parts of plugins, which would be a good reason to only keep the plugins you actually use. 

Salman

David Lowry-Duda

unread,
Jan 7, 2021, 2:14:39 PM1/7/21
to vim_use
Aside from startup time (especially if plugins don't use autoload), unused plugins should barely affect speed. But I'll note that it's pretty straightforward to profile vim to see what is taking time and clock cycles, in case you want to actually examine one or more suspicious plugins and determine what is causing slowness.

- DLD

Christian Brabandt

unread,
Jan 7, 2021, 2:17:44 PM1/7/21
to vim_use

On Do, 07 Jan 2021, David Lowry-Duda wrote:

> Aside from startup time (especially if plugins don't use autoload), unused plugins should barely affect speed. But I'll note that it's pretty straightforward to profile vim to see what is taking time and clock cycles, in case you want to actually examine one or more
> suspicious plugins and determine what is causing slowness.

However depending on where your plugins reside, it may take a
considerable amount of time to read in all your files. For that reason,
I am especially mad at vim-airline and vim-airline-themes.

This is slowing down starting up my editor in my WSL and I noticed the
same when my Vim installation was on a network share (possibly in
conjunction with some anti-virus application).

This is just annoying.

Best,
Christian
--
Die neue A-Klasse soll jetzt serienmäßig mit einem Überrollbügel
ausgerüstet werden.

rwmit...@gmail.com

unread,
Jan 7, 2021, 2:40:21 PM1/7/21
to vim_use

I open MacVim once and leave it up for days, if not weeks.  Load and close files in tabs as needed.  Startup time is seldom an issue.

meine

unread,
Jan 8, 2021, 3:30:36 PM1/8/21
to vim...@googlegroups.com
> Does anyone know if installed plugins affect the speed of Vim when they
> are not used?

Many Thanks for all your replies!

Wether Vim takes more memory and/or will react slower with plugins
active, I will have to find out, e.g. by monitoring htop and just
trying.

I'm not a very extensive plugin user and my box is relatively fast. It
was foremost a theoretical question, but further (and starting to use
more plugins) it could get an issue.

KR

//meine

Salman Halim

unread,
Jan 8, 2021, 3:34:04 PM1/8/21
to Vim Users
My setup has over 150 plugins. Without a doubt, there are plenty I don't use and should probably go clean up. However, as I have a noticed a drop in any speed, I haven't bothered.

--

Salman

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/X/jA2m0idxPw4PlA%40trackstand.
Reply all
Reply to author
Forward
0 new messages