GNU bug report logs -
#44638
[PATCH 1/2] autorevert: don't reuse existing watch descriptors
Previous Next
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
Spencer Baugh <sbaugh <at> catern.com> writes:
> Eli Zaretskii <eliz <at> gnu.org> writes:
>> 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.
>
> Ah. Well, the inotify comment was just an example. Even given that Emacs
> watches directories rather than files, I think this change is for the
> best - the overhead of registering 5 files directly instead of 1
> underlying directory is minimal.
So does this kind of change still seem plausible? Again, the overhead
of additional watches for the same file in the operating system is
minimal, and is rare anyway.
The alternative to this change is to add a new hash table to autorevert
which maps filenames to file-notify watches, so that autorevert can look
up duplicate watches efficiently in O(1) instead of iterating over all
watches in O(n) as it does now.
I started doing that originally, but concluded it was unnecessary since
sharing watches is unnecessary. But it's a much smaller change to
behavior while still getting the same performance gain, so if you'd
prefer that, I can do it.
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.