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

Re: Too many instances of vim?

Expand Messages
  • Ben Fritz
    ... Nope, no central Vim manager, they re all independent unless you explicitly make them communicate. Do operations outside of Vim take a long time as well,
    Message 1 of 6 , Jun 1, 2012
    • 0 Attachment
      On Friday, June 1, 2012 5:07:38 PM UTC-5, Shawn wrote:
      > Hello,
      >
      > I have used vim for several years now, but recently vim has become
      > painfully slow when it writes to disk. I am checking into other
      > possibilities, but one reason for this (in my mind) might be that I
      > have too many instances of vim up at the same time. I have 48 GB of
      > memory, so I don't think that it is a memory issue, and my files are
      > relatively small (~500 lines), so I am wondering if there is some
      > central vim manager that gets overworked if I keep pulling up vim
      > instances and not closing the others. Does this make sense? If so,
      > is there anything I can do about it other than closing the files that
      > I am keeping up? If not, any other ideas as to why it might be so
      > slow? I just saved a 650 line file, it took 34 seconds.

      Nope, no central Vim manager, they're all independent unless you explicitly make them communicate. Do operations outside of Vim take a long time as well, or just Vim? Can you reproduce it without all your personal config and plugins, too? It's possible one of those is interfering.

      I have noticed that Vim can be VERY slow if runtimepath contains network directories...I've moved my config files to my local disk to fix that.

      Or maybe you're saving a really huge .viminfo and/or undo file along with the file you're saving?

      Note Vim comes with profiling features, depending on what options you compiled with. See :help profile. You may be able to find the culprit using that, but then again, maybe not.

      --
      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
    • Marc Weber
      ... btrfs on older kernels and a linux staying up for 3-4 days can cause such behaviour. Its very unlikely that its Vims fault (unless any script is starting
      Message 2 of 6 , Jun 1, 2012
      • 0 Attachment
        > is there anything I can do about it other than closing the files that
        > I am keeping up? If not, any other ideas as to why it might be so
        > slow? I just saved a 650 line file, it took 34 seconds.
        btrfs on older kernels and a linux staying up for 3-4 days can cause
        such behaviour. Its very unlikely that its Vims fault (unless any script
        is starting to do something wired)..

        if that happens again try a different editor (nano, ...) and see how
        fast they write to find out whether its Vim or OS related.

        Marc Weber

        --
        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
      • John Beckett
        ... In addition to what Ben said, is the network in use at all during this? For example, are the files Vim is working on accessed over a network, or (if
        Message 3 of 6 , Jun 1, 2012
        • 0 Attachment
          Shawn wrote:
          > I have used vim for several years now, but recently vim has
          > become painfully slow when it writes to disk. I am checking
          > into other possibilities, but one reason for this (in my
          > mind) might be that I have too many instances of vim up at
          > the same time. I have 48 GB of memory, so I don't think that
          > it is a memory issue, and my files are relatively small (~500
          > lines), so I am wondering if there is some central vim
          > manager that gets overworked if I keep pulling up vim
          > instances and not closing the others. Does this make sense?
          > If so, is there anything I can do about it other than closing
          > the files that I am keeping up? If not, any other ideas as
          > to why it might be so slow? I just saved a 650 line file, it
          > took 34 seconds.

          In addition to what Ben said, is the network in use at all
          during this? For example, are the files Vim is working on
          accessed over a network, or (if Windows) is your profile
          or home directory accessed over the network?

          Possibly you have some plugin that is doing silly things? Use
          :scriptnames to see what is loaded, and temporarily remove
          anything not essential. If possible, start Vim like this:

          vim -N -u NONE -i NONE (files)

          Or use gvim in above. If it is now fast, one of your plugins is
          responsible. One plugin I know of that shares data between
          instances is mru.vim. I have never seen it cause a slowdown, but
          I suppose if you had hundreds of Vim instances it might.

          BTW using gvim with tab pages is often better than multiple
          instances.

          John

          --
          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
        • Dominique Pellé
          ... I m not sure what s the root cause for slow writes here, but one possibility could be that fsync() is slow on your file system. ... Read :help fsync to
          Message 4 of 6 , Jun 1, 2012
          • 0 Attachment
            Shawn <spacephys@...> wrote:

            > Hello,
            >
            > I have used vim for several years now, but recently vim has become
            > painfully slow when it writes to disk.  I am checking into other
            > possibilities, but one reason for this (in my mind) might be that I
            > have too many instances of vim up at the same time.  I have 48 GB of
            > memory, so I don't think that it is a memory issue, and my files are
            > relatively small (~500 lines), so I am wondering if there is some
            > central vim manager that gets overworked if I keep pulling up vim
            > instances and not closing the others.  Does this make sense?  If so,
            > is there anything I can do about it other than closing the files that
            > I am keeping up?  If not, any other ideas as to why it might be so
            > slow?  I just saved a 650 line file, it took 34 seconds.

            I'm not sure what's the root cause for slow writes here, but one
            possibility could be that fsync() is slow on your file system.
            If so, doing this will help:

            :set nofsync

            Read ":help fsync" to be aware of the possible drawbacks in case
            of system crash.

            Personally, I use ":set nofsync" on my laptop to avoid spinning
            the disk whenever I write to file. I consider Linux reliable enough
            that I can afford delaying the write. My ~/.vimrc contains:

            if exists('+fsync') | set nofsync | endif

            Regards
            -- Dominique

            --
            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
          • Shawn
            Thanks to everyone, your inputs were all good possibilities. It turns out that Ben s suggestion to test the plugins was the one I needed. When I stopped using
            Message 5 of 6 , Jun 2, 2012
            • 0 Attachment
              Thanks to everyone, your inputs were all good possibilities. It turns
              out that Ben's suggestion to test the plugins was the one I needed.
              When I stopped using one of my python plugins everything started
              working as expected.

              -shawn

              On Jun 1, 10:16 pm, Dominique Pellé <dominique.pe...@...> wrote:
              > Shawn <spacep...@...> wrote:
              > > Hello,
              >
              > > I have used vim for several years now, but recently vim has become
              > > painfully slow when it writes to disk.  I am checking into other
              > > possibilities, but one reason for this (in my mind) might be that I
              > > have too many instances of vim up at the same time.  I have 48 GB of
              > > memory, so I don't think that it is a memory issue, and my files are
              > > relatively small (~500 lines), so I am wondering if there is some
              > > central vim manager that gets overworked if I keep pulling up vim
              > > instances and not closing the others.  Does this make sense?  If so,
              > > is there anything I can do about it other than closing the files that
              > > I am keeping up?  If not, any other ideas as to why it might be so
              > > slow?  I just saved a 650 line file, it took 34 seconds.
              >
              > I'm not sure what's the root cause for slow writes here, but one
              > possibility could be that fsync() is slow on your file system.
              > If so, doing this will help:
              >
              >    :set nofsync
              >
              > Read ":help fsync" to be aware of the possible drawbacks in case
              > of system crash.
              >
              > Personally, I use ":set nofsync" on my laptop to avoid spinning
              > the disk whenever I write to file. I consider Linux reliable enough
              > that I can afford delaying the write. My ~/.vimrc contains:
              >
              > if exists('+fsync') | set nofsync | endif
              >
              > Regards
              > -- Dominique

              --
              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
            Your message has been successfully submitted and would be delivered to recipients shortly.