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

Profiling vim

Expand Messages
  • Marco
    Hi, since recently vim is maxing out my CPU a while after a file is loaded. It s definitely caused by my .vimrc (maybe a plugin?) Plain vim doesn t exhibit the
    Message 1 of 17 , Mar 26, 2013
      Hi,

      since recently vim is maxing out my CPU a while after a file is
      loaded. It's definitely caused by my .vimrc (maybe a plugin?) Plain
      vim doesn't exhibit the behaviour. Is there a simple method to tell
      what it's doing while hitting the CPU? I tried using the build-in
      profiling commands, but it doesn't seem to work. What I did:

      vim -c 'profile start log' somefile
      # wait some time
      :q

      But the log file is empty.

      Otherwise I have to bisect my .vimrc, which I want to prevent, since
      it will be tedious as there's a time delay between loading the file
      and vim hitting my CPU. (Gosh, I'm happy vim is single-threaded :)


      Marco
    • Marc Weber
      vim -V20/tmp/log will write a logfile. use tail -f (on *nix like os) to follow the file. If it goes crazy you have chance to understand what is going on. Also
      Message 2 of 17 , Mar 26, 2013
        vim -V20/tmp/log will write a logfile.

        use tail -f (on *nix like os) to follow the file.
        If it goes crazy you have chance to understand what is going on.

        Also try to find out whether it happen in insert or normal mode or
        command mode (eg after typing :)

        Yes - bisecting is a good way - and bisecting plugins is easy.
        vim-addon-manager even automates it.

        Think about which plugins could have async behaviour - eg which
        utilize CPU every X seconds - maybe you can limit the numeber of plugins
        which are more likely to cause it fast.

        If you paste your plugin list, maybe the list can also help judging it.

        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

        ---
        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.
      • Marco
        ... I blindly typed this command. You should have warned me that it produces hundreds of MiB within seconds ;) ... It did, indeed. The culprit was the easytags
        Message 3 of 17 , Mar 26, 2013
          On 2013–03–26 Marc Weber wrote:

          > vim -V20/tmp/log will write a logfile.

          I blindly typed this command. You should have warned me that it
          produces hundreds of MiB within seconds ;)

          > use tail -f (on *nix like os) to follow the file.
          > If it goes crazy you have chance to understand what is going on.

          It did, indeed.

          The culprit was the easytags plugin, which is removed from my system
          now after I've seen a bug report about a similar issue from 10
          months ago.

          > Yes - bisecting is a good way - and bisecting plugins is easy.

          It's easy, indeed. But if you have to wait 10 seconds before you can
          advance to the next step it's getting boring.

          > vim-addon-manager even automates it.

          Also when vim eats 100% CPU and blocks?

          > If you paste your plugin list, maybe the list can also help judging it.

          You just want to ensure that I use vim-addon-manager, admit it ;)

          Thanks for the quick and competent help, it solved my problem.


          Marco
        • Marc Weber
          ... If the plugin still allows you to type :qa!, then yes. Often you can abort the current operation by pressing ctrl-c Marc Weber -- -- You received this
          Message 4 of 17 , Mar 26, 2013
            > Also when vim eats 100% CPU and blocks?
            If the plugin still allows you to type :qa!, then yes. Often you can
            abort the current operation by pressing ctrl-c

            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

            ---
            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.
          • Marc Weber
            ... Thanks for trusting me :) You should never do that. ... Now you understand why I advertise vim-addon-manager, because you can contribute a warning like
            Message 5 of 17 , Mar 26, 2013
              Excerpts from Marco's message of Wed Mar 27 00:11:01 +0100 2013:
              > On 2013–03–26 Marc Weber wrote:
              > > vim -V20/tmp/log will write a logfile.
              > I blindly typed this command.
              Thanks for trusting me :) You should never do that.

              > The culprit was the easytags plugin, which is removed from my system
              > now after I've seen a bug report about a similar issue from 10
              > months ago.
              Now you understand why I advertise vim-addon-manager, because you can
              contribute a warning like these: (line 58 and following):
              https://github.com/MarcWeber/vim-addon-manager-known-repositories/blob/master/db/patchinfo.vim

              This way you can serve the community and warn others that there might be
              problems with a plugin.

              VAM does not block plugins, but it'll show an additional confirmation
              message.

              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

              ---
              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.
            • Marc Weber
              https://github.com/xolox/vim-easytags/issues/27 Anyway, you should leave a comment that this is happening to you too, to make it more likely that the author
              Message 6 of 17 , Mar 26, 2013
                https://github.com/xolox/vim-easytags/issues/27
                Anyway, you should leave a comment that this is happening to you too, to
                make it more likely that the author takes action.

                Just uninstalling the plugin is not helping anybody.

                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

                ---
                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.
              • Marco
                ... Usually I submit a bug report when there is none. But generally I refrain from submitting ”me, too” comments. Furthermore, the easytags project doesn t
                Message 7 of 17 , Mar 26, 2013
                  On 2013–03–27 Marc Weber wrote:

                  > https://github.com/xolox/vim-easytags/issues/27
                  > Anyway, you should leave a comment that this is happening to you too, to
                  > make it more likely that the author takes action.

                  Usually I submit a bug report when there is none. But generally I
                  refrain from submitting ”me, too” comments. Furthermore, the
                  easytags project doesn't seem to be very active, according to the
                  commit history the issue list.

                  > Just uninstalling the plugin is not helping anybody.

                  I don't need this plugin. It hogs my computer and serves no useful
                  purpose. And I ensured that the maintainer is aware of the issue
                  (apparently since 10 months already). What else do you expect me to
                  do?


                  Marco
                • Marc Weber
                  ... 1) There is no better way to tell devs that their plugins are being used. 2) The bug report says sometimes it just completely locks up You said it always
                  Message 8 of 17 , Mar 26, 2013
                    Excerpts from Marco's message of Wed Mar 27 01:20:22 +0100 2013:
                    > Usually I submit a bug report when there is none. But generally I
                    > refrain from submitting ”me, too” comments.
                    1) There is no better way to tell devs that their plugins are being used.
                    2) The bug report says "sometimes it just completely locks up"
                    You said it always locks up after 10 secs.

                    So your case is much more urgent ? That's why I thought it would be
                    little more than just "me too".

                    > easytags project doesn't seem to be very active, according to the
                    > commit history the issue list.
                    Right, then we should mask it in vim-addon-manager-known-repository for
                    those reasons - being almost unmaintained?

                    > I don't need this plugin. It hogs my computer and serves no useful
                    > purpose.
                    Then I wonder why you installed it at all - you must have been looking
                    for something.

                    Have you found an alternative serving you well? If so I'd like to
                    document that in the deprecation message in VAM-kr.

                    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

                    ---
                    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.
                  • Marco
                    ... Not more urgent, but more precise. Actually I think it corresponds to the updatetime , but that s just an assumption. ... That s a harsh step to take. I
                    Message 9 of 17 , Mar 27, 2013
                      On 2013–03–27 Marc Weber wrote:

                      > 2) The bug report says "sometimes it just completely locks up"
                      > You said it always locks up after 10 secs.
                      >
                      > So your case is much more urgent ?

                      Not more urgent, but more precise. Actually I think it corresponds
                      to the 'updatetime', but that's just an assumption.

                      > > easytags project doesn't seem to be very active, according to the
                      > > commit history the issue list.
                      > Right, then we should mask it in vim-addon-manager-known-repository for
                      > those reasons - being almost unmaintained?

                      That's a harsh step to take. I would try to contact the maintainer
                      and ask about the status. He will tell you. If he does not, well,
                      that's an answer, too. There might be valid reasons for this. Maybe
                      he did not see the bug reports or he moved the active repo to a
                      different place or he was on holiday and will catch up with the
                      development soon, etc. You never know.

                      > > I don't need this plugin. It hogs my computer and serves no useful
                      > > purpose.
                      > Then I wonder why you installed it at all - you must have been looking
                      > for something.

                      No. Once in a while (after reading some blog posts or getting bored)
                      I install a bunch of new plugins and macros. 90% of those I never
                      use. Every now and then I clean up my vimrc and remove all those
                      plugins of which I don't even know what they are supposed to do.
                      That's my way of discovering new functionality.

                      The last two plugins which I consider awesome and definitely improve
                      my productivity are 'vim-gitgutter' (the first thing I did was
                      telling the dev how great his plugin is, in form of a bug report,
                      which was fixed within no time BTW) and 'unicode'.

                      > Have you found an alternative serving you well?

                      The plugin adds or improves the syntax highlighting. That's very
                      nice and pretty, but doesn't really improve the workflow.

                      Sorry, no suggestions for alternatives. Perhaps other users will
                      join the thread at this point.


                      Marco
                    • Christian Brabandt
                      ... What does git-gutter do better than any of the existing plugins? regards, Christian -- -- You received this message from the vim_use maillist. Do not
                      Message 10 of 17 , Mar 27, 2013
                        On Wed, March 27, 2013 09:31, Marco wrote:
                        > The last two plugins which I consider awesome and definitely improve
                        > my productivity are 'vim-gitgutter' (the first thing I did was
                        > telling the dev how great his plugin is, in form of a bug report,
                        > which was fixed within no time BTW) and 'unicode'.

                        What does git-gutter do better than any of the existing plugins?

                        regards,
                        Christian

                        --
                        --
                        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.
                      • Marco
                        ... What are those “existing plugins”? I m curious. Marco
                        Message 11 of 17 , Mar 27, 2013
                          On 2013–03–27 Christian Brabandt wrote:

                          > What does git-gutter do better than any of the existing plugins?

                          What are those “existing plugins”? I'm curious.

                          Marco
                        • Christian Brabandt
                          ... http://www.vim.org/scripts/script.php?script_id=3052 http://www.vim.org/scripts/script.php?script_id=2712
                          Message 12 of 17 , Mar 27, 2013
                            On Wed, March 27, 2013 10:13, Marco wrote:
                            > On 2013 03 27 Christian Brabandt wrote:
                            >
                            >> What does git-gutter do better than any of the existing plugins?
                            >
                            > What are those existing pluginsť? I'm curious.

                            http://www.vim.org/scripts/script.php?script_id=3052
                            http://www.vim.org/scripts/script.php?script_id=2712
                            http://www.vim.org/scripts/script.php?script_id=2584
                            http://www.vim.org/scripts/script.php?script_id=1881

                            There are probably even more...

                            regards,
                            Christian

                            --
                            --
                            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.
                          • Marco
                            ... It has several bugs and throws vim errors. Seemed too much hassle to get it working. Maybe I should report some bugs. ... No documentation and doesn t seem
                            Message 13 of 17 , Mar 27, 2013
                              On 2013–03–27 Christian Brabandt wrote:

                              > >> What does git-gutter do better than any of the existing plugins?
                              > >
                              > > What are those existing pluginsť? I'm curious.
                              >
                              > http://www.vim.org/scripts/script.php?script_id=3052

                              It has several bugs and throws vim errors. Seemed too much hassle to
                              get it working. Maybe I should report some bugs.

                              > http://www.vim.org/scripts/script.php?script_id=2712

                              No documentation and doesn't seem to be in active development.

                              > http://www.vim.org/scripts/script.php?script_id=2584

                              I didn't know that one. I just tried it and it seems to work fine.
                              Would definitely be an alternative.

                              > http://www.vim.org/scripts/script.php?script_id=1881

                              I couldn't get that one to work.


                              Marco
                            • Christian Brabandt
                              ... Please do. As I am the maintainer I am interested in getting those fixed. regards, Christian -- -- You received this message from the vim_use maillist.
                              Message 14 of 17 , Mar 27, 2013
                                On Wed, March 27, 2013 11:29, Marco wrote:
                                > On 2013–03–27 Christian Brabandt wrote:
                                >
                                >> >> What does git-gutter do better than any of the existing plugins?
                                >> >
                                >> > What are those existing pluginsť? I'm curious.
                                >>
                                >> http://www.vim.org/scripts/script.php?script_id=3052
                                >
                                > It has several bugs and throws vim errors. Seemed too much hassle to
                                > get it working. Maybe I should report some bugs.

                                Please do. As I am the maintainer I am interested in getting those
                                fixed.

                                regards,
                                Christian

                                --
                                --
                                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.
                              • Gary Johnson
                                ... What is the attractiveness of using signs to indicate where changes have taken place? When I follow changes, I m more interested in _what_ the changes
                                Message 15 of 17 , Mar 28, 2013
                                  On 2013-03-27, Christian Brabandt wrote:
                                  > On Wed, March 27, 2013 10:13, Marco wrote:
                                  > > On 2013 03 27 Christian Brabandt wrote:
                                  > >
                                  > >> What does git-gutter do better than any of the existing plugins?
                                  > >
                                  > > What are those existing pluginsť? I'm curious.
                                  >
                                  > http://www.vim.org/scripts/script.php?script_id=3052
                                  > http://www.vim.org/scripts/script.php?script_id=2712
                                  > http://www.vim.org/scripts/script.php?script_id=2584
                                  > http://www.vim.org/scripts/script.php?script_id=1881
                                  >
                                  > There are probably even more...

                                  What is the attractiveness of using signs to indicate where changes
                                  have taken place? When I follow changes, I'm more interested in
                                  _what_ the changes were, not just that something changed. For this
                                  I use DiffOrig or a variation that compares the current buffer with
                                  the latest (or a specified) VCS version. Having a sign in the left
                                  column doesn't tell me enough to be useful.

                                  Regards,
                                  Gary

                                  --
                                  --
                                  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
                                  Hi Gary! ... I don t know. I made the plugin for fun a couple of years ago after a similar question here. Personally, I don t see the sense of the indicators
                                  Message 16 of 17 , Mar 29, 2013
                                    Hi Gary!

                                    On Do, 28 Mär 2013, Gary Johnson wrote:

                                    > On 2013-03-27, Christian Brabandt wrote:
                                    > > On Wed, March 27, 2013 10:13, Marco wrote:
                                    > > > On 2013 03 27 Christian Brabandt wrote:
                                    > > >
                                    > > >> What does git-gutter do better than any of the existing plugins?
                                    > > >
                                    > > > What are those existing pluginsť? I'm curious.
                                    > >
                                    > > http://www.vim.org/scripts/script.php?script_id=3052
                                    > > http://www.vim.org/scripts/script.php?script_id=2712
                                    > > http://www.vim.org/scripts/script.php?script_id=2584
                                    > > http://www.vim.org/scripts/script.php?script_id=1881
                                    > >
                                    > > There are probably even more...
                                    >
                                    > What is the attractiveness of using signs to indicate where changes
                                    > have taken place? When I follow changes, I'm more interested in
                                    > _what_ the changes were, not just that something changed. For this
                                    > I use DiffOrig or a variation that compares the current buffer with
                                    > the latest (or a specified) VCS version. Having a sign in the left
                                    > column doesn't tell me enough to be useful.

                                    I don't know. I made the plugin for fun a couple of years ago after a
                                    similar question here. Personally, I don't see the sense of the
                                    indicators but I can understand, if some people like it.

                                    regards,
                                    Christian
                                    --
                                    Alle Männer vom Fach sind darin sehr übel dran, dass ihnen nicht
                                    erlaubt ist, das Unnütze zu ignorieren.
                                    -- Goethe, Maximen und Reflektionen, Nr. 964

                                    --
                                    --
                                    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
                                    ... This is funny, because I just installed a change indicator plugin yesterday (I didn t use one before). I used this one (which is quite new, and not in your
                                    Message 17 of 17 , Mar 29, 2013
                                      On Thursday, March 28, 2013 1:39:16 PM UTC-5, Gary Johnson wrote:
                                      > On 2013-03-27, Christian Brabandt wrote:
                                      > > On Wed, March 27, 2013 10:13, Marco wrote:
                                      > > > On 2013 03 27 Christian Brabandt wrote:
                                      > > >
                                      > > >> What does git-gutter do better than any of the existing plugins?
                                      > > >
                                      > > > What are those existing pluginsť? I'm curious.
                                      > >
                                      > > http://www.vim.org/scripts/script.php?script_id=3052
                                      > > http://www.vim.org/scripts/script.php?script_id=2712
                                      > > http://www.vim.org/scripts/script.php?script_id=2584
                                      > > http://www.vim.org/scripts/script.php?script_id=1881
                                      > >
                                      > > There are probably even more...

                                      This is funny, because I just installed a change indicator plugin yesterday (I
                                      didn't use one before). I used this one (which is quite new, and not in your
                                      list):

                                      http://www.vim.org/scripts/script.php?script_id=4487

                                      I save too often (impulsively, even) for a "changes since last save" to be
                                      useful to me at all. So Christian's "changesPlugin" (at least from reading the
                                      description) is no good for me.

                                      I did not see sign-diff, which is one reason I didn't try it. I may not have
                                      anyway; it has not had an update on vim.org since 2009 (maybe that's just
                                      because it's so stable, I don't know). Additionally, the description says "a
                                      cmd.exe shows up at front". I don't know how distracting that would be, the
                                      video link won't load for me.

                                      I also did not see quickfixsigns, I did not realize that one could show change
                                      indicators as well. This one I probably won't try, unless the balloon popups
                                      show the actual changed lines or something. I already get the quickfix signs
                                      through Eclim so I don't need that feature. Apparently the plugin also does
                                      relative line numbers and some other things. This seems like too much feature
                                      bloat for my tastes. Eclim is the only 3rd-party plugin I use frequently that
                                      has a ton of features I don't use. I generally like my plugins lean, mean, and
                                      focused.

                                      svndiff doesn't work on Windows. I tried this one first and attempted to make it
                                      work on Windows, but it uses shell redirection in ways that just won't work for
                                      Windows, so I gave it up.

                                      From the name and from a quick glance at the documentation, it looks like
                                      git-gutter only supports git. I only use Mercurial and SVN. So that's a complete
                                      nonstarter.

                                      signify (the one I installed) didn't work on Windows out-of-the-box when I
                                      installed it, but the fixes were easy and have been incorporated (in much better
                                      fashion) in the upstream. So I'm using it now and am quite happy with it. It is
                                      a small, focused plugin with all the features I want for now. The only thing
                                      it's missing is an easy way to see the original line for changed or deleted
                                      lines. I could see myself adding a balloonexpr for this in the future if the
                                      devs don't do it for me first.

                                      >
                                      > What is the attractiveness of using signs to indicate where changes
                                      > have taken place? When I follow changes, I'm more interested in
                                      > _what_ the changes were, not just that something changed. For this
                                      > I use DiffOrig or a variation that compares the current buffer with
                                      > the latest (or a specified) VCS version. Having a sign in the left
                                      > column doesn't tell me enough to be useful.
                                      >

                                      I like the visual indication of where I've made changes; I can normally remember
                                      what those changes were after seeing the visual reminder that I made one. It's a
                                      nice way to remind myself, "oops, I'd better remove that debug code before I
                                      build" or "oh yeah, I added a new variable, I better defined it" or other such
                                      things. I always do a full diff before I commit, but most of the time I just am
                                      looking for a quick reminder of what I'm working on, and going out to Kdiff3
                                      or hacking a "diff with comitted version" vim command is overkill.

                                      --
                                      --
                                      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.