Wednesday, November 15, 2017

Re: Vim surprisingly slow?

On 2017-11-15 08:25, Christian Brabandt wrote:
> On Mi, 15 Nov 2017, Dominique Pellé wrote:
> > As highlighted in red, notice that we only write 179,281 bytes to
> > file "20150425.txt" but we open/write/close/fsync 5004 times.
> > That repeated I/O patterns kills performance, especially because
> > of the frequent fsync().
[snip]
> > Maybe we can change vim to avoid the constant
> > open/write/close/fsync on file "20150425.txt" which should speed
> > it up greatly.

However, my understanding is that the writefile() method should be
doing the same thing (open, append, close) and that's as fast as I
expect. Though I could be wrong and writefile() might internally
cache the file handle.

> Thanks for this nice analysis. It is probably the fsync call that
> is slowing Vim down. We can avoid the fsync by disabling the
> 'fsync' option.

Does the writefile() method does an fsync() too? If not, it's a
strong indicator that the fsync() may be part of the guilty slowness.

If the writefile() version does an fsync() we may be barking up the
wrong tree.

I'll test the patch later today when I'm not about to run out the
door.

Thanks!

-tim



--
--
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@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment