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.
That's not the same. ":rv" reads the whole viminfo file, while reading it for marks only does a small part of the work. My experience is that expanding file names (e.g., for marks) takes most of the time, I guess that will be skipped. It's difficult to think of a way to measure this. 2 out of 46 seconds is not that much anyway. > 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 Clever. -- Every person is responsible for the choices he makes. /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ download, build and distribute -- http://www.A-A-P.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
