vimgrep performance

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

vimgrep performance

Woody Wu

Hi,

When running vimgrep, I see on the screen the buffer is quickly
refreshed with many many files.  I guess this slow down the vimgrep
speed.  Can this behavior be disabled?

Thanks.

--
Life is the only flaw in an otherwise perfect nonexistence
    -- Schopenhauer

narke
public key at http://subkeys.pgp.net:11371 ([hidden email])

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: vimgrep performance

Bugzilla from mortgat@gmail.com
On Tue, Oct 27, 2009 at 05:40, Steven Woody <[hidden email]> wrote:

When running vimgrep, I see on the screen the buffer is quickly
refreshed with many many files.  I guess this slow down the vimgrep
speed.  Can this behavior be disabled?

Hello, is this the same when 'lazyredraw' is set?
 
--
Benoit Mortgat
39, cours Albert Thomas
69003 Lyon, France
+33 4 27 78 31 27 / +33 6 17 15 41 58

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: vimgrep performance

Woody Wu

On Tue, Oct 27, 2009 at 2:26 PM, Benoit Mortgat <[hidden email]> wrote:
> On Tue, Oct 27, 2009 at 05:40, Steven Woody <[hidden email]> wrote:
>>
>> When running vimgrep, I see on the screen the buffer is quickly
>> refreshed with many many files.  I guess this slow down the vimgrep
>> speed.  Can this behavior be disabled?
>
> Hello, is this the same when 'lazyredraw' is set?

Yes, it's the same.

>
> --
> Benoit Mortgat
> 39, cours Albert Thomas
> 69003 Lyon, France
> +33 4 27 78 31 27 / +33 6 17 15 41 58
>
> >
>



--
Life is the only flaw in an otherwise perfect nonexistence
    -- Schopenhauer

narke
public key at http://subkeys.pgp.net:11371 ([hidden email])

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: vimgrep performance

Benjamin Fritz
In reply to this post by Woody Wu



On Oct 26, 11:40 pm, Steven Woody <[hidden email]> wrote:
> Hi,
>
> When running vimgrep, I see on the screen the buffer is quickly
> refreshed with many many files.  I guess this slow down the vimgrep
> speed.  Can this behavior be disabled?
>
> Thanks.
>

vimgrep does not load each file it reads into the current window, it
just displays file names as it goes so that the user doesn't assume
Vim is hanging.

I don't know if this behavior is configurable or not, but I do know
that although each file is not displayed in the window, it IS read in
and all autocmds are processed. This is intentional; it allows you to
vimgrep through archive files, for example, with the appropriate
plugin. However, if all you are doing is searching through text files,
the autocmds slow it down considerably.

Try pre-pending :noautocmd to your :vimgrep command to speed things
up, unless you depend on plugins for reading the files you are
grepping.

This is discussed briefly at http://vim.wikia.com/wiki/Find_in_files_within_Vim
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: vimgrep performance

Henrik Öhman-2
In reply to this post by Woody Wu

On Oct 27, 5:40 am, Steven Woody <[hidden email]> wrote:
> Hi,
>
> When running vimgrep, I see on the screen the buffer is quickly
> refreshed with many many files.  I guess this slow down the vimgrep
> speed.  Can this behavior be disabled?

As has been mentioned, this is probably due to autocmds when the file
is read. I know that the showmarks.vim plugin has this kind of
unwanted behaviour. Do you have that plugin installed? What happens if
you disable it and try again?

Henrik.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: vimgrep performance

Woody Wu

On Wed, Oct 28, 2009 at 7:23 PM, Henrik Öhman <[hidden email]> wrote:

>
> On Oct 27, 5:40 am, Steven Woody <[hidden email]> wrote:
>> Hi,
>>
>> When running vimgrep, I see on the screen the buffer is quickly
>> refreshed with many many files.  I guess this slow down the vimgrep
>> speed.  Can this behavior be disabled?
>
> As has been mentioned, this is probably due to autocmds when the file
> is read. I know that the showmarks.vim plugin has this kind of
> unwanted behaviour. Do you have that plugin installed? What happens if
> you disable it and try again?
>
> Henrik.
>
> >
>

Thanks Henrik & Ben,  I found with the :noautocmd prefix the speed
improved much more, I am so happy.   And, I don't have showmarks
plugin, so I think must be another plugin that slow down the
performance, if possible, I like to find what it is.

And, for saving my tying, is there a way to have an alise for ':noauto vimgrep'?

Thanks.

--
Life is the only flaw in an otherwise perfect nonexistence
    -- Schopenhauer

narke
public key at http://subkeys.pgp.net:11371 ([hidden email])

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: vimgrep performance

Benjamin Fritz



On Oct 29, 10:49 am, Steven Woody <[hidden email]> wrote:
> And, for saving my tying, is there a way to have an alise for ':noauto vimgrep'?

There sure is! There are several suggestions at
http://vim.wikia.com/wiki/Find_in_files_within_Vim that not only do
this, but also fill in the word under the cursor and other such
things. I personally prefer the cabbrev method mentioned in this tip,
so that I can either hit enter to perform the default search, or hit
space and tweak it.

>
> Thanks.
>

Glad to help!
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---