Thursday, January 7, 2021

Re: do plugins affect performance?

gevisz wrote:
> вс, 3 янв. 2021 г. в 14:09, meine <trialero@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.
>
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

--
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/03ba79aa-8335-7195-7246-24609e988f9c%40drchip.org.

No comments:

Post a Comment