https://github.com/tomtom/startup_profile_vim
Profile vim startup
https://github.com/tomtom/startup_profile_vim
Last synced: 8 months ago
JSON representation
Profile vim startup
- Host: GitHub
- URL: https://github.com/tomtom/startup_profile_vim
- Owner: tomtom
- Created: 2010-09-02T15:58:48.000Z (almost 16 years ago)
- Default Branch: master
- Last Pushed: 2013-10-20T14:39:02.000Z (over 12 years ago)
- Last Synced: 2025-01-02T18:48:06.835Z (over 1 year ago)
- Language: VimL
- Homepage: http://www.vim.org/scripts/script.php?script_id=2915
- Size: 96.7 KB
- Stars: 7
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
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.