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

Speed up gvim startup

Expand Messages
  • Peng Yu
    Hi, My gvim command takes about 4 seconds to start, and my vim command takes about 2 seconds to start. I am wondering how to speed up gvim and vim ?
    Message 1 of 10 , Sep 12, 2009
      Hi,

      My 'gvim' command takes about 4 seconds to start, and my 'vim' command
      takes about 2 seconds to start. I am wondering how to speed up 'gvim'
      and 'vim'?

      Regards,
      Peng
      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • sc
      ... two things i can suggest: * load as few plugins as possible * remove all :source, :pyf and any other commands that cause i/o from your .vimrc -- i noticed
      Message 2 of 10 , Sep 12, 2009
        On Saturday 12 September 2009, Peng Yu wrote:

        > My 'gvim' command takes about 4 seconds to start, and my
        > 'vim' command takes about 2 seconds to start. I am
        > wondering how to speed up 'gvim' and 'vim'?

        two things i can suggest:

        * load as few plugins as possible

        * remove all :source, :pyf and any other commands that cause
        i/o from your .vimrc -- i noticed a big improvement in
        startup time when i took those out of mine and added any
        needed functions directly to .vimrc

        if i want to load a specific module that defines a bunch of
        functions i have a <Leader> command to do that so i don't
        have to load them at every start

        sc


        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Peng Yu
        ... I have run vim -u NONE and gvim -u NONE (without any files opened). The runtime does not get improvement. Since they don t load the .vimrc file and no
        Message 3 of 10 , Sep 12, 2009
          On Sep 12, 5:08 pm, sc <tooth...@...> wrote:
          > On Saturday 12 September 2009, Peng Yu wrote:
          >
          > > My 'gvim' command takes about 4 seconds to start, and my
          > > 'vim' command takes about 2 seconds to start. I am
          > > wondering how to speed up 'gvim' and 'vim'?
          >
          > two things i can suggest:
          >
          > * load as few plugins as possible
          >
          > * remove all :source, :pyf and any other commands that cause
          > i/o from your .vimrc -- i noticed a big improvement in
          > startup time when i took those out of mine and added any
          > needed functions directly to .vimrc
          >
          > if i want to load a specific module that defines a bunch of
          > functions i have a <Leader> command to do that so i don't
          > have to load them at every start

          I have run 'vim -u NONE' and 'gvim -u NONE' (without any files
          opened). The runtime does not get improvement. Since they don't load
          the .vimrc file and no files are opened. I think that there might be
          due to some other reasons.

          Regards,
          Peng
          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Tim Chase
          ... A couple other bits of information might help track things down: - what are your build options? Are you running a huge build of vim? Loads of add-ons
          Message 4 of 10 , Sep 12, 2009
            > I have run 'vim -u NONE' and 'gvim -u NONE' (without any files
            > opened). The runtime does not get improvement. Since they don't load
            > the .vimrc file and no files are opened. I think that there might be
            > due to some other reasons.

            A couple other bits of information might help track things down:

            - what are your build options? Are you running a "huge" build of
            vim? Loads of add-ons such as python/perl/ruby interpreters
            included? including the output of ":version" might help.

            - though unlikely, are your executables on some sort of slow
            storage? (a network drive, slow CD drive, a USB 1.0 connection, etc)

            - is it faster if you have a pre-existing copy of (g)vim running
            at the time? (and thus the executable is in memory already)

            - if you run (non-g)vim with "-X", is it faster?

            - though it shouldn't matter *too* much, are you hard-pressed for
            memory? (memory has only been a problem for me when I was using
            a full-featured version of vim on an old laptop with only 32 megs
            of memory)

            - when you do start up with "-u NONE", what is the output of
            ":scriptnames" (*should* return nothing)?


            Hope this gets us enough information to track down the issue.

            -tim




            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • pansz
            ... I had tested on my Pentium III 667MHz with 320M memory: 1. vim started within 1 second. (tested in ubuntu 8.04+Vim 7.2.93) 2. there s no big difference
            Message 5 of 10 , Sep 13, 2009
              sc 写道:
              > On Saturday 12 September 2009, Peng Yu wrote:
              >> My 'gvim' command takes about 4 seconds to start, and my
              >> 'vim' command takes about 2 seconds to start. I am
              >> wondering how to speed up 'gvim' and 'vim'?
              >
              > two things i can suggest:
              >
              > * load as few plugins as possible
              >
              > * remove all :source, :pyf and any other commands that cause
              > i/o from your .vimrc -- i noticed a big improvement in
              > startup time when i took those out of mine and added any
              > needed functions directly to .vimrc


              I had tested on my Pentium III 667MHz with 320M memory:

              1. vim started within 1 second. (tested in ubuntu 8.04+Vim 7.2.93)
              2. there's no big difference between vim Tiny and vim Huge.
              3. put all my 10 plugins doesn't not change either.


              I think most modern computers have a better CPU than my Pentium III and
              have more Memory than 320M, so that I think using vim Huge or load lots
              of vim plugins makes no noticeable differences in most modern computers.

              If vim takes 2 or 4 seconds to start there really is some problem...

              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_use" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • ma
              This could be a problem if you compiled vim with the X11 libraries and your display is not set properly. Try to start vim with a -X (that s a capital X) and
              Message 6 of 10 , Sep 13, 2009
                This could be a problem if you compiled vim with the X11 libraries and
                your display is not set properly. Try to start vim with a -X (that's a
                capital X) and see if there is a difference.

                --Sent from my iPhone

                On Sep 13, 2009, at 8:46 PM, pansz <panshizhu@...> wrote:

                >
                > sc 写道:
                >> On Saturday 12 September 2009, Peng Yu wrote:
                >>> My 'gvim' command takes about 4 seconds to start, and my
                >>> 'vim' command takes about 2 seconds to start. I am
                >>> wondering how to speed up 'gvim' and 'vim'?
                >>
                >> two things i can suggest:
                >>
                >> * load as few plugins as possible
                >>
                >> * remove all :source, :pyf and any other commands that cause
                >> i/o from your .vimrc -- i noticed a big improvement in
                >> startup time when i took those out of mine and added any
                >> needed functions directly to .vimrc
                >
                >
                > I had tested on my Pentium III 667MHz with 320M memory:
                >
                > 1. vim started within 1 second. (tested in ubuntu 8.04+Vim 7.2.93)
                > 2. there's no big difference between vim Tiny and vim Huge.
                > 3. put all my 10 plugins doesn't not change either.
                >
                >
                > I think most modern computers have a better CPU than my Pentium III
                > and
                > have more Memory than 320M, so that I think using vim Huge or load
                > lots
                > of vim plugins makes no noticeable differences in most modern
                > computers.
                >
                > If vim takes 2 or 4 seconds to start there really is some problem...
                >
                > >

                --~--~---------~--~----~------------~-------~--~----~
                You received this message from the "vim_use" maillist.
                For more information, visit http://www.vim.org/maillist.php
                -~----------~----~----~----~------~----~------~--~---
              • Tim Chase
                ... This manifestation of slowness usually triggers a much longer (20-30 second?) delay while vim hunts for X. When you get that long console-vim startup, the
                Message 7 of 10 , Sep 14, 2009
                  > This could be a problem if you compiled vim with the X11
                  > libraries and your display is not set properly. Try to start
                  > vim with a -X (that's a capital X) and see if there is a
                  > difference.

                  This manifestation of slowness usually triggers a much longer
                  (20-30 second?) delay while vim hunts for X. When you get that
                  long console-vim startup, the -X is the first suggestion.

                  However, the OP also mentioned slowness when running gvim which
                  makes me think this isn't the issue. Unless the OP is running X
                  over a slow network...

                  -tim




                  --~--~---------~--~----~------------~-------~--~----~
                  You received this message from the "vim_use" maillist.
                  For more information, visit http://www.vim.org/maillist.php
                  -~----------~----~----~----~------~----~------~--~---
                • pansz
                  ... It won t take 20-30 seconds, I ve done an experiment right now: start vim, it starts instantly. (roughly 0.3 second) corrupt the X setting, then start vim,
                  Message 8 of 10 , Sep 14, 2009
                    Tim Chase 写道:
                    >> This could be a problem if you compiled vim with the X11
                    >> libraries and your display is not set properly. Try to start
                    >> vim with a -X (that's a capital X) and see if there is a
                    >> difference.
                    >
                    > This manifestation of slowness usually triggers a much longer
                    > (20-30 second?) delay while vim hunts for X. When you get that
                    > long console-vim startup, the -X is the first suggestion.

                    It won't take 20-30 seconds, I've done an experiment right now:

                    start vim, it starts instantly. (roughly 0.3 second)

                    corrupt the X setting, then start vim, it takes 2 seconds to start.

                    start vim with -X, it starts instantly, (roughly 0.2 second).

                    repeat the test 3 times and I've got the same result.

                    I use screen for this test, I corrupt X setting by attach to screen in
                    another computer.


                    --~--~---------~--~----~------------~-------~--~----~
                    You received this message from the "vim_use" maillist.
                    For more information, visit http://www.vim.org/maillist.php
                    -~----------~----~----~----~------~----~------~--~---
                  • Gary Johnson
                    ... It depends on your operating system. On HP-UX, it took a few seconds. On Solaris, it took several tens of seconds. Regards, Gary
                    Message 9 of 10 , Sep 14, 2009
                      On 2009-09-15, pansz wrote:
                      > Tim Chase ??????:
                      > >> This could be a problem if you compiled vim with the X11
                      > >> libraries and your display is not set properly. Try to start
                      > >> vim with a -X (that's a capital X) and see if there is a
                      > >> difference.
                      > >
                      > > This manifestation of slowness usually triggers a much longer
                      > > (20-30 second?) delay while vim hunts for X. When you get that
                      > > long console-vim startup, the -X is the first suggestion.
                      >
                      > It won't take 20-30 seconds, I've done an experiment right now:
                      >
                      > start vim, it starts instantly. (roughly 0.3 second)
                      >
                      > corrupt the X setting, then start vim, it takes 2 seconds to start.
                      >
                      > start vim with -X, it starts instantly, (roughly 0.2 second).
                      >
                      > repeat the test 3 times and I've got the same result.
                      >
                      > I use screen for this test, I corrupt X setting by attach to screen in
                      > another computer.

                      It depends on your operating system. On HP-UX, it took a few
                      seconds. On Solaris, it took several tens of seconds.

                      Regards,
                      Gary



                      --~--~---------~--~----~------------~-------~--~----~
                      You received this message from the "vim_use" maillist.
                      For more information, visit http://www.vim.org/maillist.php
                      -~----------~----~----~----~------~----~------~--~---
                    • Matt Wozniski
                      ... Other env vars, like $SESSION_MANAGER, can contribute greatly to startup time as well, and are also bypassed with -X ~Matt
                      Message 10 of 10 , Sep 15, 2009
                        On Tue, Sep 15, 2009 at 1:11 AM, Gary Johnson wrote:
                        >
                        > On 2009-09-15, pansz wrote:
                        >> Tim Chase ??????:
                        >> >> This could be a problem if you compiled vim with the X11
                        >> >> libraries and your display is not set properly. Try to start
                        >> >> vim with a -X (that's a capital X) and see if there is a
                        >> >> difference.
                        >> >
                        >> > This manifestation of slowness usually triggers a much longer
                        >> > (20-30 second?) delay while vim hunts for X.  When you get that
                        >> > long console-vim startup, the -X is the first suggestion.
                        >>
                        >> It won't take 20-30 seconds, I've done an experiment right now:
                        >>
                        >> start vim, it starts instantly. (roughly 0.3 second)
                        >>
                        >> corrupt the X setting, then start vim, it takes 2 seconds to start.
                        >>
                        >> start vim with -X, it starts instantly, (roughly 0.2 second).
                        >>
                        >> repeat the test 3 times and I've got the same result.
                        >>
                        >> I use screen for this test, I corrupt X setting by attach to screen in
                        >> another computer.
                        >
                        > It depends on your operating system.  On HP-UX, it took a few
                        > seconds.  On Solaris, it took several tens of seconds.

                        Other env vars, like $SESSION_MANAGER, can contribute greatly to
                        startup time as well, and are also bypassed with -X

                        ~Matt

                        --~--~---------~--~----~------------~-------~--~----~
                        You received this message from the "vim_use" maillist.
                        For more information, visit http://www.vim.org/maillist.php
                        -~----------~----~----~----~------~----~------~--~---
                      Your message has been successfully submitted and would be delivered to recipients shortly.