startup_profile


Ⅰ. 插件描述

Profile vim startup

Ⅱ. 基本信息

创建日期:  2010-01-04
使用用户:  2
Github星:  6
插件作者:  Tom Link

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'tomtom/startup-profile'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'tomtom/startup-profile'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'tomtom/startup-profile'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/tomtom/startup_profile_vim

Ⅳ. 文档说明

With the introduction of the autoload directory, plugins were often
split into several separate files. The downside is that it isn't always
that obvious which files are actually loaded on startup.

You can use the :scriptnames command to get a list of files that were
loaded during startup. This list tells you the order in which the files
were loaded but it doesn't tell you much about the impact of that script
on startup time. So what you actually want is a list of the scripts
including certain indicators of how long it took to process a script.

From version 7.3 on, vim has a |--startuptime| command-line option that can be
used to achieve something similar.

This macro creates a CSV file, which included the following information:

* Number of the script
* Filename
* Number of line
* Number of bytes
* Timestamp
* Approximate time it took to process the script (actually the time it 
  took until the next script was loaded)

You can open this (semicolon-separated) CSV in any spreadsheet
application, sort the data etc.

The list can serve as a starting point for optimizing your startup time,
for example by delaying certain calls to functions in autoload files or
by making use of the AsNeeded plugin

In order to activate the macro, check the value of g:startup_profile_csv
in the source code and temporarily insert the following line(s) at the
beginning of your |vimrc| file: >

" Setting g:startup_profile_csv is optional.
let g:startup_profile_csv = "..."
runtime macros/startup_profile.vim

The list can serve as a starting point for optimizing your startup time,
e.g. by delaying certain calls to functions in autoload files or by
making use of the AsNeeded plugin (vimscript #915).

Depending on your system configuration and the speed of your hard drive,
seeking for files or, e.g., creating menu entries may prove to be costly
with respect to startup time.

This script itself changes startup time because it accesses every script
in order to find out its size and the number of lines.

This script logs all files until the |VimEnter| event is triggered. It
is assumed that any files loaded thereafter are specific to the file
being edited.

Related~

* AsNeeded plugin: http://www.vim.org/scripts/script.php?script_id=915
* Wiki page: http://vim.wikia.com/wiki/Optimize_startup_time_by_logging_the_sourced_vimscript_files

Status: Works for me (there may be some minor quirks)
Install: See http://github.com/tomtom/vimtlib/blob/master/INSTALL.TXT
See http://github.com/tomtom for related plugins.

添加新评论