13

I have some plugins installed for vim, I would like to know how can I find out what plugin uses most resources (CPU, RAM) ?

12

This isn't really possible. Vim doesn't have any concept of isolation, everything lives in a big, happy, single-threaded process, and resources are democratically shared among all plugins. The best you can do is enable profiling (see :help profiling) and see which functions take the most time to run, but that won't tell you much about either CPU or memory use.

You might consider asking the neovim people though, they might have pondered about these issues.

2

Maybe one approach could be

vim --startuptime vim.log

Then you can sort vim.log output to get the most time consuming plugin. You can then profile vim startup with

vim -c 'profile start vim.log' -c 'profile func *' -c 'q'

This is rather verbose, but will print every function loading time, this way you can measure which function/plugin delay vim loading.

Take a look at this post

Improving Vim's Startup Time

  • Note that this will only profile the startup time, and nothing else. It's useful, but very limited. – Martin Tournoij Mar 2 '16 at 15:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.