GNU bug report logs -
#35418
[PATCH] Don't poll auto-revert files that use notification
Previous Next
Reported by: Mattias Engdegård <mattiase <at> acm.org>
Date: Wed, 24 Apr 2019 18:16:02 UTC
Severity: normal
Tags: patch
Done: Mattias Engdegård <mattiase <at> acm.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
29 apr. 2019 kl. 14.18 skrev Michael Albinus <michael.albinus <at> gmx.de>:
>
>> I decided to maintain it as a derived state
>> because it felt silly to replace O(1) code with O(N), and the
>> invariant is clear enough (stated in its doc string). (Some of the
>> places where the variable is updated are O(N) but less frequently
>> executed.)
>
> Yes, but is N large enough to experience the difference?
These things are tricky to measure, but obviously inefficient code just doesn't feel right to write. For example, generating a list just to see if it is non-empty, when that could be determined in a more straightforward way.
> My proposal was to use it NOT as a predicate, but as a function
> returning the buffer list.
Very well; here is an incremental patch (to make the differences clear). It's a compromise: the derived state is gone, but there are two functions: one for the list of buffers that need to be polled, and one for whether that list would be non-empty.
By the way, the patch now uses functions from cl-lib, not just macros. Is there any reason not to?
[0001-Eliminate-the-auto-revert-polled-buffers-variable.patch (application/octet-stream, attachment)]
This bug report was last modified 6 years and 55 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.