downside to setting a very low updattime value?

5 views
Skip to first unread message

rob

unread,
Jan 13, 2008, 11:59:17 AM1/13/08
to vim_use
Hi,

I set the updatetime to 10 ms, just so the taglist plugin would
refresh to the current tag scope. And that's the only reason and I
didn't know of a better way than this.

Is there any drastic side effect of setting such a low value?

Thanks!

Tony Mechelynck

unread,
Jan 13, 2008, 12:45:47 PM1/13/08
to vim...@googlegroups.com

The downside is that some low-priority activities, such as writing the
swapfile to disk, are triggered more often, increasing CPU and disk load.

The default 'updatetime' is 4000 (4 seconds), which almost avoids triggering
it when you're busy typing, either in Insert mode to enter text, or in other
modes to do various editing tasks: it only happens when "you haven't hit a key
for four seconds". With your setting of 10 (1/100 second), you will in
practice trigger a disk write for every keypress, which might slow your system
in general, and Vim in particular, down to a crawl.


Best regards,
Tony.
--
"Dying is a very dull, dreary affair. And my advice to you is to have
nothing whatever to do with it."
-- W. Somerset Maugham

Andreas Müller

unread,
Jan 13, 2008, 4:40:45 PM1/13/08
to vim...@googlegroups.com
Tony Mechelynck schrieb:

> rob wrote:
>> Hi,
>>
>> I set the updatetime to 10 ms, just so the taglist plugin would
>> refresh to the current tag scope. And that's the only reason and I
>> didn't know of a better way than this.
>>
>> Is there any drastic side effect of setting such a low value?
>>
>> Thanks!
>
> The downside is that some low-priority activities, such as writing the
> swapfile to disk, are triggered more often, increasing CPU and disk load.

This can be solved by doing

set swapsync=''

which will let your OS choose when to sync (according to the help, this
may mean never on some systems, though, so I guess it should be used
with care).

Regards, Andreas

signature.asc

Yegappan Lakshmanan

unread,
Jan 13, 2008, 4:50:53 PM1/13/08
to vim...@googlegroups.com
Hi,

You should refer to the following in the taglist help file:

Q. When I set the 'updatetime' option to a low value (less than 1000) and if
I keep pressing a key with the taglist window open, the current buffer
contents are changed. Why is this?
A. The taglist plugin uses the CursorHold autocmd to highlight the current
tag. The CursorHold autocmd triggers after every 'updatetime' milliseconds.
If the 'updatetime' option is set to a low value, then the CursorHold
autocmd will be triggered frequently. As the taglist plugin changes
the focus to the taglist window to highlight the current tag, this could
interfere with the key movement resulting in changing the contents of
the current buffer. The workaround for this problem is to not set the
'updatetime' option to a low value.

- Yegappan

A.Politz

unread,
Jan 13, 2008, 5:48:48 PM1/13/08
to vim...@googlegroups.com
rob wrote:

In case some CursorHoldI aucmd is running, the i_CTRL-X commands
become unusable, because the underlaying logic will be reset.
Meaning you'd have 10ms to trigger the completion you need after
pressing <C-X> in insertmode.

-ap

--
Ich hab geträumt, der Krieg wär vorbei.

Yakov

unread,
Jan 14, 2008, 2:01:40 AM1/14/08
to vim_use
I set my 'updatetime' to 200 (200 msec), it is low enough for
automatic
updates dependent on CursorHold. I don't have any problem with 200
msec
value. I experiemented with lower values tried values like 100 msec,
but it caused me some problems.

Yakov

rob

unread,
Jan 14, 2008, 10:13:55 AM1/14/08
to vim_use
Unfortunately, I was finding 4s a bit too long for the tag list to get
refreshed, so I was trying to see if there is any way to get this done
quicker.

I can't think of any way other than setting a low updatetime value. I
wish there was a timer or something that would fire every 'timeout'
milliseconds where we could invoke a hook routine.

May be I could attach to the 'InsertEnter' and 'InsertLeave' events
via autocmd and toggle the timeout values? i.e. when I'm in insert
mode, I'll revert to the default value of 4000ms, otherwise I'll set
it to 10ms. That doesn't sound like a bad thing to do, maybe?


On Jan 13, 4:50 pm, "Yegappan Lakshmanan" <yegapp...@gmail.com> wrote:
> Hi,
>
Reply all
Reply to author
Forward
0 new messages