Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow down startup greatly #84

Open
linusboyle opened this issue Sep 2, 2018 · 6 comments
Open

Slow down startup greatly #84

linusboyle opened this issue Sep 2, 2018 · 6 comments

Comments

@linusboyle
Copy link

Hello there,I really like this colorscheme,but it's too slow to startup with this plugin enabled,even if not set to one-dark colorscheme

a startuptime log shows how greatly it affects this:

times in msec
clock self+sourced self: sourced script
clock elapsed: other lines
000.012 000.012: --- VIM STARTING ---
000.250 000.238: Allocated generic buffers
000.922 000.672: locale set
000.947 000.025: GUI prepared
000.956 000.009: clipboard setup
000.966 000.010: window checked
001.807 000.841: inits 1
001.837 000.030: parsing arguments
001.840 000.003: expanding arguments
001.881 000.041: shell init
002.238 000.357: xsmp init
002.683 000.445: Termcap init
002.776 000.093: inits 2
003.077 000.301: init highlight
005.432 001.902 001.902: sourcing /usr/share/vim/vim81/syntax/syncolor.vim
005.723 002.326 000.424: sourcing /usr/share/vim/vim81/syntax/synload.vim
017.367 011.550 011.550: sourcing /usr/share/vim/vim81/filetype.vim
017.424 014.173 000.297: sourcing /usr/share/vim/vim81/syntax/syntax.vim
018.727 015.599 001.426: sourcing /etc/vimrc
021.882 002.687 002.687: sourcing /home/linusboyle/.vim/autoload/plug.vim
026.714 000.569 000.569: sourcing /usr/share/vim/vim81/ftoff.vim
037.806 000.014 000.014: sourcing /home/linusboyle/.vim/Plug/vim-fugitive/ftdetect/fugitive.vim
037.975 000.048 000.048: sourcing /home/linusboyle/.vim/Plug/vim-markdown/ftdetect/markdown.vim
038.172 008.245 008.183: sourcing /usr/share/vim/vim81/filetype.vim
038.529 000.052 000.052: sourcing /usr/share/vim/vim81/ftplugin.vim
038.927 000.043 000.043: sourcing /usr/share/vim/vim81/indent.vim
039.095 019.948 008.352: sourcing /home/linusboyle/.vimrc.bundles
039.382 000.197 000.197: sourcing /usr/share/vim/vim81/syntax/nosyntax.vim
040.355 000.237 000.237: sourcing /usr/share/vim/vim81/syntax/syncolor.vim
040.531 000.785 000.548: sourcing /usr/share/vim/vim81/syntax/synload.vim
040.568 001.427 000.445: sourcing /usr/share/vim/vim81/syntax/syntax.vim
040.838 000.202 000.202: sourcing /usr/share/vim/vim81/syntax/nosyntax.vim
041.836 000.269 000.269: sourcing /usr/share/vim/vim81/syntax/syncolor.vim
042.010 000.814 000.545: sourcing /usr/share/vim/vim81/syntax/synload.vim
042.046 001.452 000.436: sourcing /usr/share/vim/vim81/syntax/syntax.vim
042.386 000.013 000.013: sourcing /usr/share/vim/vim81/filetype.vim
042.756 000.012 000.012: sourcing /usr/share/vim/vim81/filetype.vim
043.112 000.011 000.011: sourcing /usr/share/vim/vim81/indent.vim
043.480 000.012 000.012: sourcing /usr/share/vim/vim81/filetype.vim
043.848 000.011 000.011: sourcing /usr/share/vim/vim81/ftplugin.vim
044.218 000.012 000.012: sourcing /usr/share/vim/vim81/filetype.vim
044.584 000.010 000.010: sourcing /usr/share/vim/vim81/ftplugin.vim
044.948 000.012 000.012: sourcing /usr/share/vim/vim81/indent.vim
047.312 000.272 000.272: sourcing /usr/share/vim/vim81/syntax/syncolor.vim
048.156 000.271 000.271: sourcing /usr/share/vim/vim81/syntax/syncolor.vim
182.132 135.805 135.262: sourcing /home/linusboyle/.vim/Plug/vim-one/colors/one.vim
184.085 000.515 000.515: sourcing /usr/share/vim/vim81/syntax/syncolor.vim
185.580 000.515 000.515: sourcing /usr/share/vim/vim81/syntax/syncolor.vim
321.393 139.200 138.170: sourcing /home/linusboyle/.vim/Plug/vim-one/colors/one.vim
322.581 303.801 005.876: sourcing $HOME/.vimrc
322.585 000.108: sourcing vimrc file(s)
322.921 000.065 000.065: sourcing /home/linusboyle/.vim/Plug/neodark.vim/plugin/neodark.vim
323.118 000.064 000.064: sourcing /home/linusboyle/.vim/Plug/rename.vim/plugin/rename.vim
323.533 000.346 000.346: sourcing /home/linusboyle/.vim/Plug/tabular/plugin/Tabular.vim
324.487 000.880 000.880: sourcing /home/linusboyle/.vim/Plug/vim-surround/plugin/surround.vim
331.640 007.053 007.053: sourcing /home/linusboyle/.vim/Plug/nerdcommenter/plugin/NERD_commenter.vim
331.867 000.144 000.144: sourcing /home/linusboyle/.vim/Plug/vim-preview/plugin/preview.vim
332.003 000.066 000.066: sourcing /home/linusboyle/.vim/Plug/vim-header/plugin/header.vim
332.542 000.197 000.197: sourcing /home/linusboyle/.vim/Plug/vim-signature/autoload/signature/utils.vim
334.269 002.197 002.000: sourcing /home/linusboyle/.vim/Plug/vim-signature/plugin/signature.vim
353.477 019.100 019.100: sourcing /home/linusboyle/.vim/Plug/vim-unimpaired/plugin/unimpaired.vim
354.954 000.577 000.577: sourcing /home/linusboyle/.vim/Plug/delimitMate/autoload/delimitMate.vim
359.206 005.636 005.059: sourcing /home/linusboyle/.vim/Plug/delimitMate/plugin/delimitMate.vim
359.651 000.353 000.353: sourcing /home/linusboyle/.vim/Plug/vim-gutentags/plugin/gutentags.vim
360.046 000.319 000.319: sourcing /home/linusboyle/.vim/Plug/gutentags_plus/plugin/gutentags_plus.vim
361.139 000.198 000.198: sourcing /home/linusboyle/.vim/Plug/nerdtree/autoload/nerdtree.vim
363.070 000.666 000.666: sourcing /home/linusboyle/.vim/Plug/nerdtree/lib/nerdtree/path.vim
363.555 000.166 000.166: sourcing /home/linusboyle/.vim/Plug/nerdtree/lib/nerdtree/menu_controller.vim
363.955 000.099 000.099: sourcing /home/linusboyle/.vim/Plug/nerdtree/lib/nerdtree/menu_item.vim
364.383 000.142 000.142: sourcing /home/linusboyle/.vim/Plug/nerdtree/lib/nerdtree/key_map.vim
364.952 000.279 000.279: sourcing /home/linusboyle/.vim/Plug/nerdtree/lib/nerdtree/bookmark.vim
365.562 000.294 000.294: sourcing /home/linusboyle/.vim/Plug/nerdtree/lib/nerdtree/tree_file_node.vim
366.423 000.540 000.540: sourcing /home/linusboyle/.vim/Plug/nerdtree/lib/nerdtree/tree_dir_node.vim
366.988 000.282 000.282: sourcing /home/linusboyle/.vim/Plug/nerdtree/lib/nerdtree/opener.vim
367.602 000.327 000.327: sourcing /home/linusboyle/.vim/Plug/nerdtree/lib/nerdtree/creator.vim
367.954 000.062 000.062: sourcing /home/linusboyle/.vim/Plug/nerdtree/lib/nerdtree/flag_set.vim
368.429 000.188 000.188: sourcing /home/linusboyle/.vim/Plug/nerdtree/lib/nerdtree/nerdtree.vim
369.135 000.439 000.439: sourcing /home/linusboyle/.vim/Plug/nerdtree/lib/nerdtree/ui.vim
369.436 000.023 000.023: sourcing /home/linusboyle/.vim/Plug/nerdtree/lib/nerdtree/event.vim
369.770 000.048 000.048: sourcing /home/linusboyle/.vim/Plug/nerdtree/lib/nerdtree/notifier.vim
370.701 000.616 000.616: sourcing /home/linusboyle/.vim/Plug/nerdtree/autoload/nerdtree/ui_glue.vim
374.507 000.161 000.161: sourcing /home/linusboyle/.vim/Plug/nerdtree/nerdtree_plugin/exec_menuitem.vim
375.498 000.973 000.973: sourcing /home/linusboyle/.vim/Plug/nerdtree/nerdtree_plugin/fs_menu.vim
375.836 015.714 010.211: sourcing /home/linusboyle/.vim/Plug/nerdtree/plugin/NERD_tree.vim
376.454 000.547 000.547: sourcing /home/linusboyle/.vim/Plug/vim-fugitive/plugin/fugitive.vim
387.158 010.629 010.629: sourcing /home/linusboyle/.vim/Plug/vim-easymotion/plugin/EasyMotion.vim
388.067 000.212 000.212: sourcing /home/linusboyle/.vim/Plug/vim-airline/autoload/airline/init.vim
389.104 000.300 000.300: sourcing /home/linusboyle/.vim/Plug/vim-airline/autoload/airline/parts.vim
390.305 003.067 002.555: sourcing /home/linusboyle/.vim/Plug/vim-airline/plugin/airline.vim
390.418 000.023 000.023: sourcing /home/linusboyle/.vim/Plug/vim-airline-themes/plugin/airline-themes.vim
391.815 001.323 001.323: sourcing /home/linusboyle/.vim/Plug/LeaderF/plugin/leaderf.vim
392.319 000.108 000.108: sourcing /usr/share/vim/vim81/plugin/getscriptPlugin.vim
392.626 000.285 000.285: sourcing /usr/share/vim/vim81/plugin/gzip.vim
393.147 000.495 000.495: sourcing /usr/share/vim/vim81/plugin/logiPat.vim
393.221 000.049 000.049: sourcing /usr/share/vim/vim81/plugin/manpager.vim
393.561 000.317 000.317: sourcing /usr/share/vim/vim81/plugin/matchparen.vim
394.502 000.917 000.917: sourcing /usr/share/vim/vim81/plugin/netrwPlugin.vim
394.619 000.082 000.082: sourcing /usr/share/vim/vim81/plugin/rrhelper.vim
394.693 000.040 000.040: sourcing /usr/share/vim/vim81/plugin/spellfile.vim
394.950 000.226 000.226: sourcing /usr/share/vim/vim81/plugin/tarPlugin.vim
395.101 000.120 000.120: sourcing /usr/share/vim/vim81/plugin/tohtml.vim
395.388 000.255 000.255: sourcing /usr/share/vim/vim81/plugin/vimballPlugin.vim
395.686 000.259 000.259: sourcing /usr/share/vim/vim81/plugin/zipPlugin.vim
395.694 002.430: loading plugins
395.773 000.079: loading packages
396.781 000.557 000.557: sourcing /home/linusboyle/.vim/Plug/tabular/autoload/tabular.vim
399.449 003.538 002.981: sourcing /home/linusboyle/.vim/Plug/tabular/after/plugin/TabularMaps.vim
399.635 000.076 000.076: sourcing /home/linusboyle/.vim/Plug/vim-signature/after/plugin/signature.vim
399.683 000.296: loading after plugins
400.191 000.508: inits 3
400.962 000.130 000.130: sourcing /home/linusboyle/.vim/Plug/LeaderF/autoload/lfMru.vim
401.314 000.993: reading viminfo
404.049 002.735: setup clipboard
404.163 000.114: setting raw mode
404.304 000.141: start termcap
404.369 000.065: clearing screen
405.425 000.508 000.508: sourcing /home/linusboyle/.vim/Plug/vim-airline/autoload/airline/extensions.vim
406.059 000.136 000.136: sourcing /home/linusboyle/.vim/Plug/vim-airline/autoload/airline/extensions/quickfix.vim
406.725 000.318 000.318: sourcing /home/linusboyle/.vim/Plug/vim-airline/autoload/airline.vim
407.232 000.072 000.072: sourcing /home/linusboyle/.vim/Plug/vim-airline/autoload/airline/extensions/netrw.vim
407.726 000.035 000.035: sourcing /home/linusboyle/.vim/Plug/vim-airline/autoload/airline/extensions/term.vim
408.408 000.163 000.163: sourcing /home/linusboyle/.vim/Plug/vim-airline/autoload/airline/util.vim
409.155 000.325 000.325: sourcing /home/linusboyle/.vim/Plug/vim-airline/autoload/airline/extensions/branch.vim
409.806 000.084 000.084: sourcing /home/linusboyle/.vim/Plug/vim-airline/autoload/airline/extensions/fugitiveline.vim
410.559 000.193 000.193: sourcing /home/linusboyle/.vim/Plug/vim-airline/autoload/airline/extensions/whitespace.vim
411.256 000.064 000.064: sourcing /home/linusboyle/.vim/Plug/vim-airline/autoload/airline/extensions/po.vim
411.803 000.066 000.066: sourcing /home/linusboyle/.vim/Plug/vim-airline/autoload/airline/extensions/wordcount.vim
412.394 000.035 000.035: sourcing /home/linusboyle/.vim/Plug/vim-airline/autoload/airline/extensions/gutentags.vim
412.812 000.039 000.039: sourcing /home/linusboyle/.vim/Plug/vim-airline/autoload/airline/extensions/keymap.vim
417.774 000.085 000.085: sourcing /home/linusboyle/.vim/Plug/vim-airline/autoload/airline/section.vim
418.275 000.206 000.206: sourcing /home/linusboyle/.vim/Plug/vim-airline/autoload/airline/highlighter.vim
421.926 000.085 000.085: sourcing /home/linusboyle/.vim/Plug/vim-airline/autoload/airline/themes.vim
422.200 000.764 000.679: sourcing /home/linusboyle/.vim/Plug/vim-airline-themes/autoload/airline/themes/violet.vim
434.870 000.264 000.264: sourcing /home/linusboyle/.vim/Plug/vim-airline/autoload/airline/builder.vim
435.821 000.135 000.135: sourcing /home/linusboyle/.vim/Plug/vim-airline/autoload/airline/extensions/default.vim
472.066 064.205: opening buffers
472.918 000.388 000.388: sourcing /home/linusboyle/.vim/Plug/vim-signature/autoload/signature/sign.vim
473.838 000.402 000.402: sourcing /home/linusboyle/.vim/Plug/vim-signature/autoload/signature/mark.vim
484.847 011.991: BufEnter autocommands
484.851 000.004: editing files in windows
492.771 000.659 000.659: sourcing /home/linusboyle/.vim/Plug/nerdtree/syntax/nerdtree.vim
635.648 000.679 000.679: sourcing /home/linusboyle/.vim/Plug/vim-gutentags/autoload/gutentags.vim
636.602 150.413: VimEnter autocommands
636.605 000.003: before starting main loop
673.603 036.998: first screen update
673.605 000.002: --- VIM STARTED ---

I disabled the plugin and start again,this time only 300ms used. It seems not only colorscheme itself but the airline-plugin also takes too much time to load.

and here is my vim version:

VIM - Vi IMproved 8.1 (2018 May 18)
Patchs: 1-258
...
+acl +extra_search +mouse_netterm +tag_old_static
+arabic +farsi +mouse_sgr -tag_any_white
+autocmd +file_in_path -mouse_sysmouse -tcl
+autochdir +find_in_path +mouse_urxvt +termguicolors
-autoservername +float +mouse_xterm +terminal
+balloon_eval +folding +multi_byte +terminfo
+balloon_eval_term -footer +multi_lang +termresponse
+browse +fork() -mzscheme +textobjects
++builtin_terms +gettext +netbeans_intg +timers
+byte_offset -hangul_input +num64 +title
+channel +iconv +packages +toolbar
+cindent +insert_expand +path_extra +user_commands
+clientserver +job +perl +vartabs
+clipboard +jumplist +persistent_undo +vertsplit
+cmdline_compl +keymap +postscript +virtualedit
+cmdline_hist +lambda +printer +visual
+cmdline_info +langmap +profile +visualextra
+comments +libcall +python/dyn +viminfo
+conceal +linebreak +python3/dyn +vreplace
+cryptv +lispindent +quickfix +wildignore
+cscope +listcmds +reltime +wildmenu
+cursorbind +localmap +rightleft +windows
+cursorshape +lua/dyn +ruby/dyn +writebackup
+dialog_con_gui +menu +scrollbind +X11
+diff +mksession +signs -xfontset
+digraphs +modify_fname +smartindent +xim
+dnd +mouse +startuptime -xpm
-ebcdic +mouseshape +statusline +xsmp_interact
+emacs_tags +mouse_dec -sun_workshop +xterm_clipboard
+eval +mouse_gpm +syntax -xterm_save
+ex_extra -mouse_jsbterm +tag_binary
...

@linusboyle linusboyle changed the title Slow down startuptime greatly Slow down startup greatly Sep 2, 2018
@christopher-francisco
Copy link

christopher-francisco commented Oct 31, 2018

Here is my profiling:

...
129.668  087.747  087.354: sourcing /Users/me/.vim/plugged/vim-one/colors/one.vim
...
592.448  002.263  002.073: sourcing /Users/me/.vim/plugged/vim-one/autoload/airline/themes/one.vim

Not sure if I know how to read this properly, but vim-one seems to take 87ms to load(?), and the airlines theme 2ms(?).

Most of my plugins takes 0.xxx ms(?) to load, except tpope's sensible and unimpaired. Is this something that can be worked and improved?

@AckmanDESU
Copy link

AckmanDESU commented Nov 14, 2018

Agreed. No idea why this is but vim-one is taking forever to load. These are my top 3 load times:

vim-one: (70.13ms)
nerdtree: (9.492ms)
vim-polyglot: (2.41 ms)

It's just ridiculous. I use a couple dozen plugins and not one of them comes close.

@chrisgrounds
Copy link
Contributor

Same for me

=====================================
Top 10 plugins slowing nvim's startup
=====================================
1       158.536   vim-one
2         5.463   nerdtree
3         3.014   vim-airline
4         2.015   delimitMate
...

@chrisgrounds
Copy link
Contributor

Think I've got a fix. Will push a PR later.

@rnevius
Copy link

rnevius commented Jan 9, 2019

Also see #74

@laggardkernel
Copy link

Made a fork to improve the startup time.

# the original one
❯ vim-profiler.py -r 10 nvim
=====================================
Top 10 plugins slowing nvim's startup
=====================================
1       170.621   vim-one
2         6.274   vim-airline
3         4.038   vim-polyglot
4         3.496   coc.nvim
5         2.645   colorizer
6         2.413   vim-textobj-xmlattr
7         2.313   vim-textobj-comment
8         1.795   vim-sensible
9         1.664   vim-textobj-line
10        1.341   ctrlp.vim
=====================================

# the hard-coded
❯ vim-profiler.py -r 10 nvim
=====================================
Top 10 plugins slowing nvim's startup
=====================================
1        11.172   vim-one
2         6.650   vim-airline
3         3.960   vim-polyglot
4         3.579   coc.nvim
5         2.830   colorizer
6         2.405   vim-textobj-comment
7         2.372   vim-textobj-xmlattr
8         1.732   vim-sensible
9         1.724   vim-textobj-line
10        1.430   ctrlp.vim
=====================================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants