Profiling Vim startup time

前端 未结 10 448
孤独总比滥情好
孤独总比滥情好 2020-12-07 07:16

I’ve got a lot of plugins enabled when using Vim – I have collected plugins over the years. I’m a bit fed up with how long Vim takes to start now, so I’d like to profile it

10条回答
  •  温柔的废话
    2020-12-07 07:29

    You could run vim -V, pipe the output through a utility that adds timestamps and analyze the output. This command lines does this, e.g.:

    vim -V 2>&1 | perl -MTime::HiRes=time -ne 'print time, ": ", $_' | tee vilog
    

    You might have to blindly type :q to get back to your prompt. Afterwards, you should find the file vilog in your current directory with hires timestamps at the beginning of each line.

    If you can do with a granularity of a second, you can do this:

    vim -V 2>&1 | perl -ne 'print time, ": ", $_' | tee vilog
    

提交回复
热议问题