How to see which plugins are making Vim slow?

charlax picture charlax · Aug 31, 2012 · Viewed 66k times · Source

Is there a way to profile Vim plugins?

My MacVim becomes slower and slower when I open a large .py. I know I could deselect all plugins and reselect one by one to check which plugin is the culprit, but is there a faster way?

My dotvim is here: https://github.com/charlax/dotvim

Answer

ZyX picture ZyX · Aug 31, 2012

You can use built-in profiling support: after launching vim do

:profile start profile.log
:profile func *
:profile file *
" At this point do slow actions
:profile pause
:noautocmd qall!

(unlike quitting noautocmd is not really required, it just makes vim quit faster).

Note: you won’t get information about functions there were deleted before vim quit.