GNU bug report logs - #77775
30.1; Proced performance

Previous Next

Package: emacs;

Reported by: Rahguzar <rahguzar <at> mailbox.org>

Date: Sun, 13 Apr 2025 07:28:04 UTC

Severity: normal

Found in version 30.1

Full log


View this message in rfc822 format

From: Azeem Hasan <rahguzar <at> mailbox.org>
To: Roland Winkler <winkler <at> gnu.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Laurence Warne <laurencewarne <at> gmail.com>, 77775 <at> debbugs.gnu.org
Subject: bug#77775: 30.1; Proced performance
Date: Mon, 14 Apr 2025 09:24:35 +0500
Hi Roland,

Roland Winkler <winkler <at> gnu.org> writes:

> On Sun, Apr 13 2025, Eli Zaretskii wrote:
>>>    ;; If none of the alternatives is non-nil, the attribute is ignored
>>>    ;; in the listing.
>>>    (let ((standard-attributes
>>> -         (car (proced-process-attributes (list-system-processes))))
>>> +         (car (proced-process-attributes (last (list-system-processes)))))
>>>          new-format fmi)
>>>      (if (and proced-tree-flag
>>>               (assq 'ppid standard-attributes))
>>> 
>>> (The comment at the start of this diff is outdated)
>
> Why is this comment outdated?  Previously, proced-format used emacs-pid
> instead of (list-system-processes), which is obviously much faster.

The comment talks about `emacs-pid' and I couldn't see how it is using
`emacs-pid' and was confused about it till I checked history and saw
that this used to be the case. Why is why I called it outdated. It is
likely to cause confusion for someone like me reading the code for the
first time.

Looking at how the process-alist passed to `proced-format' is
constructed, I think a better change that preserves current behavior
would be:

diff --git a/lisp/proced.el b/lisp/proced.el
index 51e6f3aca4d..f03213f5764 100644
--- a/lisp/proced.el
+++ b/lisp/proced.el
@@ -1747,8 +1747,7 @@ proced-format
   ;; attributes, we take the first attribute that is non-nil for `emacs-pid'.
   ;; If none of the alternatives is non-nil, the attribute is ignored
   ;; in the listing.
-  (let ((standard-attributes
-         (car (proced-process-attributes (list-system-processes))))
+  (let ((standard-attributes (car process-alist))
         new-format fmi)
     (if (and proced-tree-flag
              (assq 'ppid standard-attributes))


> I haven't been engaged in the development of proced.el for some time.
> But I feel I need to look at the current code more carefully before I
> can comment on this patch (and the problem it is supposed to fix) in a
> meaningful way.
>
> Roland

Rahguzar




This bug report was last modified 12 days ago.

Previous Next


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