Tuesday, November 14, 2017

Re: Vim surprisingly slow?

On Di, 14 Nov 2017, Tim Chase wrote:

> On 2017-11-14 22:15, Christian Brabandt wrote:
> > Some more things to try:
> > Does `:set ei=all` or using `:noa :.w` make a difference perhaps?
>
> Makes no difference that I could tell. I ^C'ed it after about 30
> seconds in both cases.

Okay, no autocommand comes in the way.

> > Also does it work better if you explicitly use e.g. writefile('',
> > 'a')?
>
> Much faster!
>
> :g/.*name":"\([^"]*\)".*card":"\([^"]*\)".*/let
> s=substitute(getline('.'),
> '.*stamp":"\(\d\+\)-\(\d\+\)-\(\d\+\).*','\1\2\3','').'.txt'|s//\1,\2/|call
> writefile([getline('.')], s, 'a')
>
>
> runs in about the same time as the "echo" version or the "append it
> to a list" version (i.e., one second or less).

I am puzzled now. Is that buffer loaded? Perhaps Vim (re-)writes the
undofile or needs to sync the swapfile?

Best,
Christian
--
Alle großen Wahrheiten waren anfangs Blasphemien.
-- George Bernard Shaw

--
--
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