On 4/28/06, Bram Moolenaar <[EMAIL PROTECTED]> wrote:

Yakov Lerner wrote:

> > On 4/27/06, Bram Moolenaar <[EMAIL PROTECTED]> wrote:
> > > Before even thinking of disabling autocommands, we first need proof that
> > > this actually changes the search time more than a few percent.
> > >
> > > Above that, if BufRead autocommands take so much time there is probably
> > > something wrong with them.  You should find out why this happens.
>
> I see that BufRead autocommands are not related to speed of
> vimgrep.
>
> But why viminfo needs to be read for every grepped file ?
> Command "20verb vimgrep ..." shows
>
>     Reading viminfo file "/home/Yakov/.viminfo" marks
>
> for every grepped file. Is it really needed ?

It is only needed if the buffer contains a match.  But we can't predict
that.  Using another mechanism would be a bit complicated.

How much extra time does it take to read the marks from the .viminfo
file?

There are 1358 files in $VIMRUNTIME (vim7f).
Executint this with no :au commands (vim -u NONE)
   TIM vimgrep klslkjljklkj $VIMRUNTIME/**
takes 46 sec.
Executing ':rv' 1358 times takes 2 sec.


Yakov

P.S.
command! -nargs=* -range TIMING :<count>call TIMING(<q-args>)

function! TIMING(args) range
   let start=reltime()
   exe a:args
   echo "Execution took " . reltimestr(reltime(start))." sec."
endfu

Reply via email to