unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Spencer Baugh <sbaugh@catern.com>
Cc: sbaugh@catern.com, 44638@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	[thread overview]
Message-ID: <835z67vooa.fsf@gnu.org> (raw)
In-Reply-To: <20201114165459.9518-1-sbaugh@catern.com> (message from Spencer Baugh on Sat, 14 Nov 2020 11:54:58 -0500)

> From: Spencer Baugh <sbaugh@catern.com>
> Date: Sat, 14 Nov 2020 11:54:58 -0500
> Cc: Spencer Baugh <sbaugh@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.





  parent reply	other threads:[~2020-11-14 17:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-14 16:54 bug#44638: [PATCH 1/2] autorevert: don't reuse existing watch descriptors Spencer Baugh
2020-11-14 16:54 ` bug#44639: [PATCH 2/2] autorevert: map each watch descriptor to a single buffer Spencer Baugh
2020-12-02 14:50   ` Michael Albinus
2021-01-27  3:59     ` Lars Ingebrigtsen
2021-01-27 16:34       ` Spencer Baugh
2021-01-28  3:29         ` Lars Ingebrigtsen
2021-01-28 14:19           ` Michael Albinus
2020-11-14 17:22 ` Eli Zaretskii [this message]
2020-11-14 21:19   ` bug#44638: [PATCH 1/2] autorevert: don't reuse existing watch descriptors Spencer Baugh
2020-11-30 18:01     ` Spencer Baugh
2020-11-30 18:21       ` Eli Zaretskii
2020-11-30 18:31         ` Michael Albinus
2020-12-01 20:16           ` Michael Albinus
2020-12-02  3:20             ` Eli Zaretskii
2020-12-02 15:17               ` Michael Albinus
2020-12-02 15:41                 ` Eli Zaretskii
2020-12-02 17:05                   ` Michael Albinus
2020-12-02 17:13                     ` Eli Zaretskii
2020-12-02 17:20                       ` Michael Albinus
2020-12-02 17:43                         ` Eli Zaretskii
2020-12-03 15:01                         ` Michael Albinus
2020-12-02 17:46                       ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=835z67vooa.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=44638@debbugs.gnu.org \
    --cc=sbaugh@catern.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).