GithubHelp home page GithubHelp logo

startuptime.vim's Introduction

startuptime.vim

startuptime

Everybody knows that 1ms could mean the difference between life and death in Vim. This plugin breaks down the output of --startuptime so you can zero in on the scripts that are stealing dozens of your milliseconds each time Vim is started. You won't even need to leave the comfort of Vim.

Usage

Use the command :StartupTime to get an averaged startup profile. By default, it collects 10 samples.

It accepts multiple arguments. If a number is found, it is used as the sample count. If a filename is found, it will be used with the -u argument while profiling.

Example collecting 100 samples and using ~/foo.vim as the vimrc script:

:StartupTime ~/foo.vim 100

If -- is found in the command arguments, everything after it will be used verbatim in the program execution.

Example collecting 100 samples with manual arguments:

:StartupTime 100 -- -u ~/foo.vim -i NONE -- ~/foo.vim

Note that the first -- is dropped.

To upload the results, you can use a plugin like gist-vim.

Details

You have been able to profile Vim's startup by using the --startuptime argument since v7.2. However, the results are written to a file and it reports timing per loaded script. The output method and results aren't very useful to a layman that just wants to know what plugins are affecting Vim's startup speed.

This plugin takes multiple samples (10 by default) of the --startuptime output and displays the average times broken down by source. A source could be your [vimrc] scripts, Vim's built-in [runtime] scripts, or plugins. Vim doesn't actually have a formal plugin system. As a result, a "plugin" is simply a path found in runtimepath that looks like a plugin. If the source can't be determined, it display as [unknown].

The results shows the total average startup time and the 10 slowest "plugins". Below it are the load times, separated by startup phases and sorted by load time. Under each phase, load times are broken down by "plugin". Under each "plugin" are the load times for individual scripts. These are folded by default and can be opened with zo if you want more detail.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.