mhinz / vim-startify

:link: The fancy start screen for Vim.
MIT License
5.31k stars 187 forks source link

How to reduce startup time #367

Closed glepnir closed 5 years ago

glepnir commented 5 years ago

Hi @mhinz Checkout neovim startuptime i found vim-startify need 20ms, 30ms or more,i tried set unsafe =1 ,but the time no obvious improvement,this is my env

Neovim :

NVIM v0.4.0-583-gd08692a82

vim-startify :

the latest

has vim-startify:

vim.log

no startify

no startify.log

mhinz commented 5 years ago

Well, this could be anything. It depends on your startify config, your system, your network, your operating system, even the directory you're in.

For my MacBook it looks like this:

076.321  000.003: editing files in windows
078.236  000.885  000.885: sourcing /Users/mhi/.vim/bundle/vim-startify/autoload/startify.vim
079.178  000.580  000.580: sourcing /Users/mhi/.vim/bundle/vim-startify/autoload/startify/fortune.vim

I noticed this line:

041.743  000.023  000.023: sourcing /Users/pendragon/.cache/dein/.cache/init.vim/.dein/autoload/devicons/plugins/startify.vim

Does disabling devicons make it faster? (Not that 20-30ms are terribly slow... :)

If it doesn't help, do nvim --cmd 'prof start /tmp/foo.log | prof file * | prof func *', then quit Nvim, then paste the two tables at the bottom of foo.log (FUNCTIONS SORTED ON TOTAL TIME and FUNCTIONS SORTED ON SELF TIME).

glepnir commented 5 years ago

It may require more environment for reference. I just want to reduce the time to less than 100. thanks for your reply. I just want to know if there have any magic that can reduce its time. If not, I will close

mhinz commented 5 years ago

Well, I can't help without knowing your Startify configuration.

And I'd still like to know how fast the startup would be with vim-devicons disabled. If it's enabled, this line will be sourced: https://github.com/ryanoasis/vim-devicons/blob/master/autoload/devicons/plugins/startify.vim#L3, which will be used by Startify.

So, maybe the majority of the slowness comes from vim-devicons.

glepnir commented 5 years ago

hmm i only set header and footer , if i remove vim-devicons ,reduce 10ms .