Profiling startup

You can start Vim with a --startuptime <filename> flag, which will log every action Vim takes during startup into a file. For instance, here's how you write the startup log into startuptime.log:

$ vim --startuptime startuptime.log

You can launch gvim in a similar manner with gvim --startuptime startuptime.log. The commands are the same in the Linux command line and in Windows cmd.exe.

Quit Vim, and open startuptime.log. You'll be greeted with something like this (I replaced sections of the file with <...> to make it easier to read):

 

 

In the preceding screenshot, you can see a set of timestamps (most in three columns), followed by an action measured by the timestamp. The timestamps are in milliseconds—1/1000 of a second. The first column indicates the number of milliseconds from starting Vim, while the last column indicates how long each action took.

It's the last column which is of interest to us. You'll be looking for any abnormalities in the file.

In our case, we don't have any particularly slow plugins, but for the sake of science, the slowest plugin we have installed is vim-unimpared (at 11 milliseconds—011.532). You'll have to get closer to 500 milliseconds (or half a second) for the plugin to have a noticeable effect on Vim startup times.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.88.249