Manas <manas18244@iiitd.ac.in> wrote:
> On Sun, Jul 16, 2023 at 10:55:04AM -0700, Gary Johnson wrote:
> > It depends, of course, on why it is slow. You can start vim with
> > the --startuptime option to get a better idea of where the slowdown
> > is. See ":help --startuptime".
> >
> > For example, starting vim on my Cygwin system was really slow
> > because I wrote my vimrc and some plugins as I would for Unix, where
> > running external programs is really fast. I re-wrote those to make
> > less use of external programs.
> >
> > As another example, starting vim on a remote Linux machine via ssh
> > and X from a local Linux machine can be slow if the connection is
> > slow because vim communicates with the X server and the terminal on
> > the local machine. I don't know what to do in that case other than
> > be patient or start vim with -X and forgo some of the features of X.
> `startuptime` surprisingly shows me a mere 656ms, while hyperfine shows
> me 2.7s. I am not sure how this discrepancy is arising. Here is the full
> log. https://pastebin.mozilla.org/uTrJ7i8N
>
> I see 234ms (out of those 656ms, ~35%) due to VimEnter autocommands. My
> autocommands are just scattered throughout vimrc. Most of them are like:
>
> au FileType <list> [mappings|calls]
>
> Maybe there is a way to organize them better?
>
> And there are a ton of plugins too. Is there any way to only source them
> conditionally?
>
> I can also try removing some of the old plugins. I haven't done a
> cleanup in a while.
In your startup file, I see:
374.858 001.193 001.193: sourcing
/home/neon/.vim/plugged/vim-gutentags/autoload/gutentags.vim
377.927 002.447 002.447: sourcing
/home/neon/.vim/plugged/YouCompleteMe/autoload/youcompleteme.vim
610.942 000.370 000.370: sourcing
/home/neon/.vim/plugged/context.vim/autoload/context/line.vim
611.846 234.541: VimEnter autocommands
611.854 000.008: before starting main loop
I don't understand how this works.
Isn't it youcompleteme.vim which is slow? since the timestamp
goes from 377.927ms to 610.942 ms.
In the original post, you said that startup took 2.6 sec but we see
it's much faster than that from vim --startup.
In my set up, youcompleteme.vim also seems to be the slowest step.
But it's faster than for you.
Did you build with -O2? Consider posting the output of
the `vim --version` command.
For comparison, this is my startup log file on
xubuntu-22.04 \(remotely access via ssh):
times in msec
clock self+sourced self: sourced script
clock elapsed: other lines
000.008 000.008: --- VIM STARTING ---
000.091 000.083: Allocated generic buffers
000.112 000.021: locale set
000.117 000.005: clipboard setup
000.122 000.005: window checked
000.447 000.325: inits 1
000.460 000.013: parsing arguments
000.461 000.001: expanding arguments
000.483 000.022: shell init
000.760 000.277: Termcap init
000.770 000.010: inits 2
000.841 000.071: init highlight
002.326 001.271 001.271: sourcing /home/dope/.vim/autoload/plug.vim
010.277 000.051 000.051: sourcing
/home/dope/.vim/plugged/csv.vim/ftdetect/csv.vim
010.444 000.017 000.017: sourcing
/home/dope/.vim/plugged/vim-qml/ftdetect/qml.vim
010.591 000.019 000.019: sourcing
/home/dope/.vim/plugged/vim-fugitive/ftdetect/fugitive.vim
010.716 000.026 000.026: sourcing
/home/dope/.vim/plugged/kotlin-vim/ftdetect/kotlin.vim
010.846 005.124 005.011: sourcing /usr/local/share/vim/vim90/filetype.vim
011.078 000.073 000.073: sourcing /usr/local/share/vim/vim90/ftplugin.vim
011.299 000.063 000.063: sourcing /usr/local/share/vim/vim90/indent.vim
012.922 000.630 000.630: sourcing
/usr/local/share/vim/vim90/colors/lists/default.vim
013.010 001.263 000.633: sourcing
/usr/local/share/vim/vim90/syntax/syncolor.vim
013.083 001.510 000.247: sourcing
/usr/local/share/vim/vim90/syntax/synload.vim
013.140 001.771 000.261: sourcing /usr/local/share/vim/vim90/syntax/syntax.vim
013.638 000.237 000.237: sourcing
/usr/local/share/vim/vim90/syntax/nosyntax.vim
014.157 000.141 000.141: sourcing
/usr/local/share/vim/vim90/syntax/syncolor.vim
014.234 000.417 000.276: sourcing
/usr/local/share/vim/vim90/syntax/synload.vim
014.288 000.978 000.324: sourcing /usr/local/share/vim/vim90/syntax/syntax.vim
014.450 000.017 000.017: sourcing /usr/local/share/vim/vim90/filetype.vim
014.658 000.020 000.020: sourcing /usr/local/share/vim/vim90/ftplugin.vim
032.776 000.550 000.550: sourcing
/usr/local/share/vim/vim90/colors/lists/default.vim
033.222 000.134 000.134: sourcing
/usr/local/share/vim/vim90/syntax/syncolor.vim
033.639 000.144 000.144: sourcing
/usr/local/share/vim/vim90/syntax/syncolor.vim
034.044 001.196 000.918: sourcing
/home/dope/.vim/plugged/rastafari/colors/rastafari.vim
034.049 033.064 022.001: sourcing $HOME/.vimrc
034.053 000.148: sourcing vimrc file(s)
034.294 000.098 000.098: sourcing
/home/dope/.vim/plugged/vim-gtest/plugin/gtest.vim
034.571 000.193 000.193: sourcing
/home/dope/.vim/plugged/csv.vim/plugin/csv.vim
035.458 000.800 000.800: sourcing
/home/dope/.vim/plugged/vim-alternate/plugin/a.vim
035.655 000.086 000.086: sourcing
/home/dope/.vim/plugged/vim-Grammalecte/plugin/Grammalecte.vim
035.818 000.076 000.076: sourcing
/home/dope/.vim/plugged/vim-LanguageTool/plugin/LanguageTool.vim
036.066 000.153 000.153: sourcing
/home/dope/.vim/plugged/vim-asterisk/plugin/asterisk.vim
036.341 000.183 000.183: sourcing
/home/dope/.vim/plugged/CommandlineComplete.vim/plugin/commandline_complete.vim
037.040 000.579 000.579: sourcing /home/dope/.vim/plugged/fzf/plugin/fzf.vim
037.934 000.775 000.775: sourcing
/home/dope/.vim/plugged/fzf.vim/plugin/fzf.vim
038.271 000.113 000.113: sourcing
/home/dope/.vim/plugged/vim-signature/autoload/signature/utils.vim
039.016 000.985 000.872: sourcing
/home/dope/.vim/plugged/vim-signature/plugin/signature.vim
039.381 000.241 000.241: sourcing
/home/dope/.vim/plugged/vim-interestingwords/plugin/interestingwords.vim
039.643 000.147 000.147: sourcing
/home/dope/.vim/plugged/undotree/plugin/undotree.vim
039.852 000.080 000.080: sourcing
/home/dope/.vim/plugged/vim-plugin-AnsiEsc/plugin/AnsiEscPlugin.vim
040.185 000.305 000.305: sourcing
/home/dope/.vim/plugged/vim-plugin-AnsiEsc/plugin/cecutil.vim
040.734 000.164 000.164: sourcing
/home/dope/.vim/plugged/nerdtree/autoload/nerdtree.vim
041.327 000.350 000.350: sourcing
/home/dope/.vim/plugged/nerdtree/lib/nerdtree/path.vim
041.564 000.131 000.131: sourcing
/home/dope/.vim/plugged/nerdtree/lib/nerdtree/menu_controller.vim
041.840 000.110 000.110: sourcing
/home/dope/.vim/plugged/nerdtree/lib/nerdtree/menu_item.vim
042.060 000.123 000.123: sourcing
/home/dope/.vim/plugged/nerdtree/lib/nerdtree/key_map.vim
042.348 000.189 000.189: sourcing
/home/dope/.vim/plugged/nerdtree/lib/nerdtree/bookmark.vim
042.633 000.182 000.182: sourcing
/home/dope/.vim/plugged/nerdtree/lib/nerdtree/tree_file_node.vim
043.072 000.337 000.337: sourcing
/home/dope/.vim/plugged/nerdtree/lib/nerdtree/tree_dir_node.vim
043.329 000.156 000.156: sourcing
/home/dope/.vim/plugged/nerdtree/lib/nerdtree/opener.vim
043.629 000.192 000.192: sourcing
/home/dope/.vim/plugged/nerdtree/lib/nerdtree/creator.vim
043.809 000.071 000.071: sourcing
/home/dope/.vim/plugged/nerdtree/lib/nerdtree/flag_set.vim
044.046 000.130 000.130: sourcing
/home/dope/.vim/plugged/nerdtree/lib/nerdtree/nerdtree.vim
044.390 000.240 000.240: sourcing
/home/dope/.vim/plugged/nerdtree/lib/nerdtree/ui.vim
044.543 000.047 000.047: sourcing
/home/dope/.vim/plugged/nerdtree/lib/nerdtree/event.vim
044.721 000.065 000.065: sourcing
/home/dope/.vim/plugged/nerdtree/lib/nerdtree/notifier.vim
045.187 000.351 000.351: sourcing
/home/dope/.vim/plugged/nerdtree/autoload/nerdtree/ui_glue.vim
047.260 000.108 000.108: sourcing
/home/dope/.vim/plugged/nerdtree/nerdtree_plugin/exec_menuitem.vim
047.852 000.554 000.554: sourcing
/home/dope/.vim/plugged/nerdtree/nerdtree_plugin/fs_menu.vim
047.967 000.076 000.076: sourcing
/home/dope/.vim/plugged/nerdtree/nerdtree_plugin/vcs.vim
048.421 000.309 000.309: sourcing
/home/dope/.vim/plugged/vim-devicons/nerdtree_plugin/webdevicons.vim
048.572 008.214 004.329: sourcing
/home/dope/.vim/plugged/nerdtree/plugin/NERD_tree.vim
049.251 000.558 000.558: sourcing
/home/dope/.vim/plugged/vim-clang-format/plugin/clang_format.vim
049.528 000.158 000.158: sourcing
/home/dope/.vim/plugged/vim-illuminate/plugin/illuminate.vim
051.124 001.494 001.494: sourcing
/home/dope/.vim/plugged/vim-devicons/plugin/webdevicons.vim
051.356 000.099 000.099: sourcing
/home/dope/.vim/plugged/vim-minimap/plugin/minimap.vim
052.532 001.052 001.052: sourcing
/home/dope/.vim/plugged/vim-fugitive/plugin/fugitive.vim
053.067 000.407 000.407: sourcing
/home/dope/.vim/plugged/vim-surround/plugin/surround.vim
053.883 000.673 000.673: sourcing
/home/dope/.vim/plugged/quick-scope/plugin/quick_scope.vim
054.444 000.437 000.437: sourcing
/home/dope/.vim/plugged/taglist.vim/plugin/taglist.vim
056.638 001.696 001.696: sourcing
/home/dope/.vim/plugged/vcscommand.vim/plugin/vcscommand.vim
056.702 002.064 000.368: sourcing
/home/dope/.vim/plugged/vcscommand.vim/plugin/vcsbzr.vim
056.869 000.137 000.137: sourcing
/home/dope/.vim/plugged/vcscommand.vim/plugin/vcscommand.vim
057.828 000.930 000.930: sourcing
/home/dope/.vim/plugged/vcscommand.vim/plugin/vcscvs.vim
058.075 000.214 000.214: sourcing
/home/dope/.vim/plugged/vcscommand.vim/plugin/vcsgit.vim
058.233 000.127 000.127: sourcing
/home/dope/.vim/plugged/vcscommand.vim/plugin/vcshg.vim
058.386 000.124 000.124: sourcing
/home/dope/.vim/plugged/vcscommand.vim/plugin/vcssvk.vim
058.658 000.242 000.242: sourcing
/home/dope/.vim/plugged/vcscommand.vim/plugin/vcssvn.vim
059.119 000.324 000.324: sourcing
/home/dope/.vim/plugged/YouCompleteMe/plugin/youcompleteme.vim
059.533 000.282 000.282: sourcing
/home/dope/.vim/plugged/taboo.vim/plugin/taboo.vim
059.908 000.090 000.090: sourcing
/usr/local/share/vim/vim90/plugin/getscriptPlugin.vim
060.125 000.179 000.179: sourcing /usr/local/share/vim/vim90/plugin/gzip.vim
060.375 000.212 000.212: sourcing
/usr/local/share/vim/vim90/plugin/logiPat.vim
060.482 000.069 000.069: sourcing
/usr/local/share/vim/vim90/plugin/manpager.vim
060.708 000.189 000.189: sourcing
/usr/local/share/vim/vim90/plugin/matchparen.vim
061.187 000.441 000.441: sourcing
/usr/local/share/vim/vim90/plugin/netrwPlugin.vim
061.307 000.068 000.068: sourcing
/usr/local/share/vim/vim90/plugin/rrhelper.vim
061.412 000.060 000.060: sourcing
/usr/local/share/vim/vim90/plugin/spellfile.vim
061.662 000.179 000.179: sourcing
/usr/local/share/vim/vim90/plugin/tarPlugin.vim
061.842 000.136 000.136: sourcing /usr/local/share/vim/vim90/plugin/tohtml.vim
062.055 000.173 000.173: sourcing
/usr/local/share/vim/vim90/plugin/vimballPlugin.vim
062.283 000.180 000.180: sourcing
/usr/local/share/vim/vim90/plugin/zipPlugin.vim
062.289 004.023: loading plugins
062.341 000.052: loading packages
062.502 000.014 000.014: sourcing
/home/dope/.vim/plugged/vim-gtest/after/plugin/ctrlp.vim
062.586 000.037 000.037: sourcing
/home/dope/.vim/plugged/vim-gtest/after/plugin/fzf.vim
062.807 000.095 000.095: sourcing
/home/dope/.vim/plugged/vim-signature/after/plugin/signature.vim
062.836 000.349: loading after plugins
062.862 000.026: inits 3
063.597 000.735: reading viminfo
075.856 012.259: setup clipboard
075.885 000.029: setting raw mode
075.891 000.006: start termcap
075.927 000.036: clearing screen
077.614 001.687: opening buffers
078.178 000.329 000.329: sourcing
/home/dope/.vim/plugged/vim-signature/autoload/signature/sign.vim
078.911 000.225 000.225: sourcing
/home/dope/.vim/plugged/vim-signature/autoload/signature/mark.vim
084.348 001.792 001.792: sourcing
/home/dope/.vim/plugged/taglist.vim/plugin/taglist.vim
084.448 004.488: BufEnter autocommands
084.450 000.002: editing files in windows
085.745 000.760 000.760: sourcing
/home/dope/.vim/plugged/YouCompleteMe/autoload/youcompleteme.vim
149.701 064.491: VimEnter autocommands
149.706 000.005: before starting main loop
149.977 000.134 000.134: sourcing
/home/dope/.vim/plugged/vim-illuminate/autoload/illuminate.vim
150.472 000.056 000.056: sourcing
/home/dope/.vim/plugged/YouCompleteMe/autoload/youcompleteme/filetypes.vim
156.201 005.052 005.052: sourcing
/home/dope/.vim/plugged/vim-fugitive/autoload/fugitive.vim
157.011 000.250 000.250: sourcing
/home/dope/.vim/plugged/nerdfont.vim/autoload/nerdfont/path/extension.vim
157.019 000.441 000.191: sourcing
/home/dope/.vim/plugged/nerdfont.vim/autoload/nerdfont.vim
157.266 000.134 000.134: sourcing
/home/dope/.vim/plugged/nerdfont.vim/autoload/nerdfont/path/pattern.vim
157.663 000.120 000.120: sourcing
/home/dope/.vim/plugged/nerdfont.vim/autoload/nerdfont/path/basename.vim
157.905 000.097 000.097: sourcing
/home/dope/.vim/plugged/nerdfont.vim/autoload/nerdfont/fileformat.vim
158.616 002.876: first screen update
158.617 000.001: --- VIM STARTED ---
$ vim --version
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Jul 9 2023 15:57:55)
Included patches: 1-1677
Compiled by dope@nl1lxd-111237
Huge version without GUI. Features included (+) or not (-):
+acl +file_in_path +mouse_urxvt -tag_any_white
+arabic +find_in_path +mouse_xterm +tcl
+autocmd +float +multi_byte +termguicolors
+autochdir +folding +multi_lang +terminal
-autoservername -footer -mzscheme +terminfo
-balloon_eval +fork() +netbeans_intg +termresponse
+balloon_eval_term +gettext +num64 +textobjects
-browse -hangul_input +packages +textprop
++builtin_terms +iconv +path_extra +timers
+byte_offset +insert_expand +perl +title
+channel +ipv6 +persistent_undo -toolbar
+cindent +job +popupwin +user_commands
+clientserver +jumplist +postscript +vartabs
+clipboard +keymap +printer +vertsplit
+cmdline_compl +lambda +profile +vim9script
+cmdline_hist +langmap -python +viminfo
+cmdline_info +libcall +python3 +virtualedit
+comments +linebreak +quickfix +visual
+conceal +lispindent +reltime +visualextra
+cryptv +listcmds +rightleft +vreplace
+cscope +localmap +ruby +wildignore
+cursorbind +lua +scrollbind +wildmenu
+cursorshape +menu +signs +windows
+dialog_con +mksession +smartindent +writebackup
+diff +modify_fname +sodium +X11
+digraphs +mouse -sound +xfontset
-dnd -mouseshape +spell -xim
-ebcdic +mouse_dec +startuptime -xpm
+emacs_tags +mouse_gpm +statusline +xsmp_interact
+eval -mouse_jsbterm -sun_workshop +xterm_clipboard
+ex_extra +mouse_netterm +syntax -xterm_save
+extra_search +mouse_sgr +tag_binary
-farsi -mouse_sysmouse -tag_old_static
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang-15 -c -I. -Iproto -DHAVE_CONFIG_H -g -O2
-D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang-15 -Wl,-E -L/usr/local/lib -Wl,--as-needed -o vim -lSM
-lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lelf -lselinux
-lsodium -lacl -lattr -lgpm -L/usr/lib -llua5.2 -Wl,-E
-fstack-protector-strong -L/usr/local/lib
-L/usr/lib/x86_64-linux-gnu/perl/5.34/CORE -lperl -ldl -lm -lpthread
-lcrypt -L/usr/lib/python3.10/config-3.10-x86_64-linux-gnu
-lpython3.10 -lcrypt -ldl -lm -lm -L/usr/lib/x86_64-linux-gnu -ltcl8.6
-ldl -lz -lpthread -lm -lruby-3.0 -lm -L/usr/lib
--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAON-T_h2UCMBDdX5BpBwsP6w%3DnhWtkWfp4aapFm%2Bp5AYs9tXLQ%40mail.gmail.com.
Sunday, July 16, 2023
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment