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

Re: functions that take much time in load_dummy_buffer() [vimgrep]

Expand Messages
  • Bram Moolenaar
    ... Perhaps Cygwin libraries do something strange. It s such a mix of Unix and MS-Windows that you never know what it s doing. You might be better off with
    Message 1 of 6 , Apr 29, 2006
      Yakov Lerner wrote:

      > > If creating the swap file takes so much time, something strange is
      > > happening. Are you on a network filesystem perhaps? What system is
      > > this anyway?
      >
      > Cygwin.

      Perhaps Cygwin libraries do something strange. It's such a mix of Unix
      and MS-Windows that you never know what it's doing. You might be better
      off with MSVC or MingW.

      > But why swapfile is needed for read-only grepping ? Is it
      > possible not to create swapfile for dummy buf ? To set readonly
      > and nonmodifiable maybe, for dummy buffer ?

      Everything is possible, but the main thing is that this works reliably
      (thus also for big files that don't fit in memory) and I don't have to
      add lots of extra code. Autocommands are very unpredictable, that is a
      major concern with making exceptions.

      > > Testing with empty files may give a wrong impression. Try something
      > > like:
      > > :vimgrep notaword $VIMRUNTIME/**/*.vim
      > > The .vim files are relatively small.
      >
      > The remove the regexp code from the picture (search can easily be
      > benchmarked separately from file loading), I used artificial temporary
      > patch which allows to run N times, see attached patch and script.

      I don't think trying to benchmark something that won't happen in real
      life is useful. You never know how the results can be translated to
      other situations.

      > > I tried doing a bit of profiling, but it gets confused by the loops and
      > > reports bogus results.
      >
      > Instead of profiling, I commented out lines in load_dummy_buffer() and
      > rerun timing. This is how I saw how different parts affect executiorn
      > time.

      That requires a lot of recompiling and testing...

      --
      Lawmakers made it obligatory for everybody to take at least one bath
      each week -- on Saturday night.
      [real standing law in Vermont, United States of America]

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