Loading ...
Sorry, an error occurred while loading the content.
 

Vim takes a lot of time "opening buffers" when opening a file for the first time

Expand Messages
  • florian.wagner@...
    Hey all, my vim takes a lot of time when opening a file for the first time. I made a vim --startuptime start.log .vimrc (my .vimrc has about 500 lines).
    Message 1 of 7 , Aug 19, 2013
      Hey all,

      my vim takes a lot of time when opening a file for the first time. I made a "vim --startuptime start.log .vimrc" (my .vimrc has about 500 lines). These are the TOP4 processes:

      2075.385 1790.067: opening buffers
      2200.133 124.203: BufEnter autocommands
      117.800 082.955 062.110: sourcing $HOME/.vimrc
      247.013 073.089 073.089: sourcing /home/fwagner/.vim/bundle/vim-fat-finger/plugin/fat-finger.vim

      Any idea how I can speed this up? Thank you very much in advance!

      --
      --
      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@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Christian Brabandt
      ... Do you have a large .viminfo file or do you load many files? ... I guess some plugins make use of many BufEnter autocommands. ... Well it just takes some
      Message 2 of 7 , Aug 19, 2013
        On Mo, 19 Aug 2013, florian.wagner@... wrote:

        > Hey all,
        >
        > my vim takes a lot of time when opening a file for the first time. I made a "vim --startuptime start.log .vimrc" (my .vimrc has about 500 lines). These are the TOP4 processes:
        >
        > 2075.385 1790.067: opening buffers

        Do you have a large .viminfo file or do you load many files?

        > 2200.133 124.203: BufEnter autocommands

        I guess some plugins make use of many BufEnter autocommands.

        > 117.800 082.955 062.110: sourcing $HOME/.vimrc
        > 247.013 073.089 073.089: sourcing /home/fwagner/.vim/bundle/vim-fat-finger/plugin/fat-finger.vim

        Well it just takes some time to load that file. This is a rather large file.

        regards,
        Christian
        --
        Der Utopist sieht das Paradies, der Realist das Paradies plus
        Schlange.
        -- Christian Friedrich Hebbel

        --
        --
        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@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Ben Fritz
        ... Or maybe, you are reading files from a network location? ... Processing startup scripts can take a long time as well if $HOME is on a network location. But
        Message 3 of 7 , Aug 19, 2013
          On Monday, August 19, 2013 3:55:03 PM UTC-5, Christian Brabandt wrote:
          > On Mo, 19 Aug 2013, florian.wagner@... wrote:
          >
          >
          >
          > > Hey all,
          >
          > >
          >
          > > my vim takes a lot of time when opening a file for the first time. I made a "vim --startuptime start.log .vimrc" (my .vimrc has about 500 lines). These are the TOP4 processes:
          >
          > >
          >
          > > 2075.385 1790.067: opening buffers
          >
          >
          >
          > Do you have a large .viminfo file or do you load many files?
          >
          >

          Or maybe, you are reading files from a network location?

          >
          > > 2200.133 124.203: BufEnter autocommands
          >
          >
          >
          > I guess some plugins make use of many BufEnter autocommands.
          >
          >
          >
          > > 117.800 082.955 062.110: sourcing $HOME/.vimrc
          >
          > > 247.013 073.089 073.089: sourcing /home/fwagner/.vim/bundle/vim-fat-finger/plugin/fat-finger.vim
          >
          >
          >
          > Well it just takes some time to load that file. This is a rather large file.
          >
          >

          Processing startup scripts can take a long time as well if $HOME is on a network location. But it doesn't *look* to be the case here.

          --
          --
          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@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Florian M. Wagner
          Hey Ben, I removed the .viminfo (1500 lines) and set viminfo= NONE but it did not change anything. I do not open any network files. ... -- -- You received
          Message 4 of 7 , Aug 19, 2013
            Hey Ben,

            I removed the .viminfo (1500 lines) and set viminfo="NONE" but it did
            not change anything. I do not open any network files.

            Am 19.08.2013 23:58, schrieb Ben Fritz:
            > On Monday, August 19, 2013 3:55:03 PM UTC-5, Christian Brabandt wrote:
            >> On Mo, 19 Aug 2013, florian.wagner@... wrote:
            >>
            >>
            >>
            >>> Hey all,
            >>> my vim takes a lot of time when opening a file for the first time. I made a "vim --startuptime start.log .vimrc" (my .vimrc has about 500 lines). These are the TOP4 processes:
            >>> 2075.385 1790.067: opening buffers
            >>
            >>
            >> Do you have a large .viminfo file or do you load many files?
            >>
            >>
            > Or maybe, you are reading files from a network location?
            >
            >>> 2200.133 124.203: BufEnter autocommands
            >>
            >>
            >> I guess some plugins make use of many BufEnter autocommands.
            >>
            >>
            >>
            >>> 117.800 082.955 062.110: sourcing $HOME/.vimrc
            >>> 247.013 073.089 073.089: sourcing /home/fwagner/.vim/bundle/vim-fat-finger/plugin/fat-finger.vim
            >>
            >>
            >> Well it just takes some time to load that file. This is a rather large file.
            >>
            >>
            > Processing startup scripts can take a long time as well if $HOME is on a network location. But it doesn't *look* to be the case here.
            >

            --
            --
            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@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • florian.wagner@...
            SOLVED! Thank you all four your help! VIMs in-house profiling function (this was new to me) helped to identify the bottleneck: FUNCTIONS SORTED ON TOTAL TIME
            Message 5 of 7 , Aug 19, 2013
              SOLVED!

              Thank you all four your help! VIMs in-house profiling function (this was new to me) helped to identify the bottleneck:

              FUNCTIONS SORTED ON TOTAL TIME
              count total (s) self (s) function
              1 1.911840 0.000174 sy#start()
              1 1.911471 0.000904 sy#repo#detect()
              2 0.440662 0.000075 tagbar#currenttag()
              2 0.440501 0.000184 <SNR>166_Init()
              3 0.376236 0.000812 <SNR>166_ExecuteCtags()
              1 0.243657 0.000271 sy#repo#get_diff_bzr()
              1 0.243428 0.000240 sy#repo#get_diff_rcs()
              1 0.233447 0.000282 sy#repo#get_diff_accurev()
              1 0.223392 0.000288 sy#repo#get_diff_darcs()
              1 0.223378 0.000288 sy#repo#get_diff_fossil()
              1 0.203176 0.000270 sy#repo#get_diff_hg()
              1 0.185362 0.000189 <SNR>166_AutoUpdate()
              1 0.185017 0.008813 <SNR>166_ProcessFile()
              1 0.152811 0.000268 sy#repo#get_diff_svn()
              1 0.133778 0.000876 <SNR>166_GetSupportedFiletypes()
              1 0.132605 0.000119 GitGutter()
              1 0.132568 0.000286 sy#repo#get_diff_cvs()

              All functions starting with sy# belong to the signify plugin (https://github.com/mhinz/vim-signify).

              --
              --
              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@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • Ben Fritz
              ... The signify plugin help encourages you to set g:signify_vcs_list to the list of version control systems you actually use. This will cut down on your
              Message 6 of 7 , Aug 20, 2013
                On Tuesday, August 20, 2013 1:51:06 AM UTC-5, florian...@... wrote:
                > SOLVED!
                >
                > Thank you all four your help! VIMs in-house profiling function (this was new to me) helped to identify the bottleneck:
                >
                > FUNCTIONS SORTED ON TOTAL TIME
                > count total (s) self (s) function
                > 1 1.911840 0.000174 sy#start()
                > 1 1.911471 0.000904 sy#repo#detect()
                > 2 0.440662 0.000075 tagbar#currenttag()
                > 2 0.440501 0.000184 <SNR>166_Init()
                > 3 0.376236 0.000812 <SNR>166_ExecuteCtags()
                > 1 0.243657 0.000271 sy#repo#get_diff_bzr()
                > 1 0.243428 0.000240 sy#repo#get_diff_rcs()
                > 1 0.233447 0.000282 sy#repo#get_diff_accurev()
                > 1 0.223392 0.000288 sy#repo#get_diff_darcs()
                > 1 0.223378 0.000288 sy#repo#get_diff_fossil()
                > 1 0.203176 0.000270 sy#repo#get_diff_hg()
                > 1 0.185362 0.000189 <SNR>166_AutoUpdate()
                > 1 0.185017 0.008813 <SNR>166_ProcessFile()
                > 1 0.152811 0.000268 sy#repo#get_diff_svn()
                > 1 0.133778 0.000876 <SNR>166_GetSupportedFiletypes()
                > 1 0.132605 0.000119 GitGutter()
                > 1 0.132568 0.000286 sy#repo#get_diff_cvs()
                >
                > All functions starting with sy# belong to the signify plugin (https://github.com/mhinz/vim-signify).

                The signify plugin help encourages you to set g:signify_vcs_list to the list of version control systems you actually use. This will cut down on your startup time significantly, since signify won't need to query for the existence of every supported version control system.

                I see a GitGutter() function. Do you have GitGutter *and* signify installed? IIUC signify does everything GitGutter does, plus supports more version control systems. But maybe GitGutter has some extra features for git?

                --
                --
                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@....
                For more options, visit https://groups.google.com/groups/opt_out.
              • Florian M. Wagner
                ... Yes Fritz, you indentified the problem very well. Setting the VCS list helped. And I removed gitgutter as well. -- -- You received this message from the
                Message 7 of 7 , Aug 20, 2013
                  Am 20.08.2013 16:24, schrieb Ben Fritz:
                  > On Tuesday, August 20, 2013 1:51:06 AM UTC-5, florian...@... wrote:
                  >> SOLVED!
                  >>
                  >> Thank you all four your help! VIMs in-house profiling function (this was new to me) helped to identify the bottleneck:
                  >>
                  >> FUNCTIONS SORTED ON TOTAL TIME
                  >> count total (s) self (s) function
                  >> 1 1.911840 0.000174 sy#start()
                  >> 1 1.911471 0.000904 sy#repo#detect()
                  >> 2 0.440662 0.000075 tagbar#currenttag()
                  >> 2 0.440501 0.000184 <SNR>166_Init()
                  >> 3 0.376236 0.000812 <SNR>166_ExecuteCtags()
                  >> 1 0.243657 0.000271 sy#repo#get_diff_bzr()
                  >> 1 0.243428 0.000240 sy#repo#get_diff_rcs()
                  >> 1 0.233447 0.000282 sy#repo#get_diff_accurev()
                  >> 1 0.223392 0.000288 sy#repo#get_diff_darcs()
                  >> 1 0.223378 0.000288 sy#repo#get_diff_fossil()
                  >> 1 0.203176 0.000270 sy#repo#get_diff_hg()
                  >> 1 0.185362 0.000189 <SNR>166_AutoUpdate()
                  >> 1 0.185017 0.008813 <SNR>166_ProcessFile()
                  >> 1 0.152811 0.000268 sy#repo#get_diff_svn()
                  >> 1 0.133778 0.000876 <SNR>166_GetSupportedFiletypes()
                  >> 1 0.132605 0.000119 GitGutter()
                  >> 1 0.132568 0.000286 sy#repo#get_diff_cvs()
                  >>
                  >> All functions starting with sy# belong to the signify plugin (https://github.com/mhinz/vim-signify).
                  > The signify plugin help encourages you to set g:signify_vcs_list to the list of version control systems you actually use. This will cut down on your startup time significantly, since signify won't need to query for the existence of every supported version control system.
                  >
                  > I see a GitGutter() function. Do you have GitGutter *and* signify installed? IIUC signify does everything GitGutter does, plus supports more version control systems. But maybe GitGutter has some extra features for git?
                  >
                  Yes Fritz, you indentified the problem very well. Setting the VCS list
                  helped. And I removed gitgutter as well.

                  --
                  --
                  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@....
                  For more options, visit https://groups.google.com/groups/opt_out.
                Your message has been successfully submitted and would be delivered to recipients shortly.