GNU bug report logs - #44638
[PATCH 1/2] autorevert: don't reuse existing watch descriptors

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> catern.com>

Date: Sat, 14 Nov 2020 16:56:02 UTC

Severity: normal

Tags: patch

Fixed in version 28.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Spencer Baugh <sbaugh <at> catern.com>
Cc: sbaugh <at> catern.com, 44638 <at> debbugs.gnu.org
Subject: bug#44638: [PATCH 1/2] autorevert: don't reuse existing watch descriptors
Date: Sat, 14 Nov 2020 19:22:29 +0200
> From: Spencer Baugh <sbaugh <at> catern.com>
> Date: Sat, 14 Nov 2020 11:54:58 -0500
> Cc: Spencer Baugh <sbaugh <at> catern.com>
> 
> Previously, when enabling autorevert for a new buffer, we would search
> the buffers already registered with autorevert to see if any of them
> had the same filename.
> 
> This is very slow with a large number of buffers - with 1000, it takes
> 2 seconds on my system. This 2-second overhead is paid for every new
> file opened.
> 
> But this is an unnecesary optimization; registering the same file
> twice with file-notify has minimal or no overhead, depending on the
> implementation.

Emacs actually watches the file's directory, not the file itself.  The
directory is what's registered with inotify and other similar
backends.

> In fact, file-notify has some baked-in overhead to support registering
> the same file twice without problems. For example, inotify on Linux
> returns the same inotify watch descriptor when the same file is
> registered twice; file-notify adds an additional uniquifying id so
> that all watch descriptors are unique in Emacs, even with inotify.

Again, we watch the directory of the file, so what inotify does with
files is not really relevant, IMO.  I wonder what that means for the
changes you propose.




This bug report was last modified 4 years and 221 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.