GNU bug report logs -
#73855
[PATCH] * lisp/autorevert.el: Avoid reverting buffer in short time
Previous Next
Reported by: Lin Sun <sunlin7.mail <at> gmail.com>
Date: Thu, 17 Oct 2024 23:28:01 UTC
Severity: normal
Tags: patch
Merged with 74490,
74491
Fixed in versions 31.1, 31.0.50
Done: Stefan Kangas <stefankangas <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 73855 <at> debbugs.gnu.org (full text, mbox):
On Fri, Oct 18, 2024 at 7:50 AM Michael Albinus <michael.albinus <at> gmx.de> wrote:
>
> In your case, where mass write happens to a file, I recommend to set
> auto-revert-use-notify to nil. Polling is used then instead, with
> auto-revert-interval interval between reverts. The default value is 5
> (seconds), you might change it to 1.
>
> Furthermore, your use case doesn't look ideal for enabling
> auto-revert-mode. Checking fast changing log files is better done with
> auto-revert-tail-mode.
>
Thanks for the comments, the tail mode worked for me; but actually I
enabled the global-auto-revert-mode, I have to manually switch to tail
mode for some buffers. And yes, the default interval value is 5
seconds.
Let's look at this case: the auto-revert-interval is 5, a writing
happened 1 write / second, total 20 writings (in 20 seconds). The
revert-handler run on: first time (T0), and then locks for 5 seconds;
then T5 lock done, revert the buffer; then T6 reverts the and locks it
again... The revert happened as below:
T0...T5,T6...T11,T12...T17,T18...T23
The T5,T6 are nearby, similar happened on T11,T12, and after each lock
end, there is a revert executed nearby.
This patch try to enhance the lock, then makes the revert happened on:
T0...T5...T10...T15...
That reduced loading on my local.
Best Regards, Lin
This bug report was last modified 176 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.