GNU bug report logs - #51420
29.0.50; [PATCH] Be more efficient when checking for a matching client or frame in server.el

Previous Next

Package: emacs;

Reported by: Jim Porter <jporterbugs <at> gmail.com>

Date: Tue, 26 Oct 2021 20:19:02 UTC

Severity: normal

Tags: patch

Found in version 29.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 51420 in the body.
You can then email your comments to 51420 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#51420; Package emacs. (Tue, 26 Oct 2021 20:19:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jim Porter <jporterbugs <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 26 Oct 2021 20:19:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; [PATCH] Be more efficient when checking for a matching
 client or frame in server.el
Date: Tue, 26 Oct 2021 13:18:05 -0700
[Message part 1 (text/plain, inline)]
Attached is a patch to eliminate unnecessary checks for matching 
clients/frames in `server-handle-delete-frame' and 
`server-kill-emacs-query-function'.

Previously, `server-handle-delete-frame' would iterate over all frames 
to check if there were any other frames associated with the current 
client. Now, it uses `seq-some' to stop iterating once it finds the 
first such frame.

Similarly, `server-kill-emacs-query-function' used to iterate over all 
clients, and then all buffers for *each* client to check if there were 
any live buffers associated with any clients. Now, it uses a pair of 
calls to `seq-some' to stop iterating once it finds a live buffer from 
any client.

I haven't benchmarked these changes since I hope the strategy of 
stopping iteration as soon as we can is uncontroversial. However, if you 
think it's important, I can try to generate some benchmarks.
[0001-Be-more-efficient-when-checking-for-a-matching-clien.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51420; Package emacs. (Tue, 26 Oct 2021 20:23:01 GMT) Full text and rfc822 format available.

Message #8 received at 51420 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: 51420 <at> debbugs.gnu.org
Subject: Re: bug#51420: 29.0.50; [PATCH] Be more efficient when checking for a
 matching client or frame in server.el
Date: Tue, 26 Oct 2021 13:22:16 -0700
[Message part 1 (text/plain, inline)]
On 10/26/2021 1:18 PM, Jim Porter wrote:
> Attached is a patch to eliminate unnecessary checks for matching 
> clients/frames in `server-handle-delete-frame' and 
> `server-kill-emacs-query-function'.

Oops, forgot to commit a typo fix before exporting the patch. Attached 
is the fixed version that actually byte-compiles. :)
[0001-Be-more-efficient-when-checking-for-a-matching-clien.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51420; Package emacs. (Wed, 27 Oct 2021 13:56:01 GMT) Full text and rfc822 format available.

Message #11 received at 51420 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 51420 <at> debbugs.gnu.org
Subject: Re: bug#51420: 29.0.50; [PATCH] Be more efficient when checking for
 a matching client or frame in server.el
Date: Wed, 27 Oct 2021 15:55:08 +0200
Jim Porter <jporterbugs <at> gmail.com> writes:

> lisp/server.el (server-handle-delete-frame): Use 'seq-some' to
> determine if another frame for the current client exists.
> (server-kill-emacs-query-function): Use 'seq-some' to determine if
> another live client exists.

Thanks; applied to Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 29.1, send any further explanations to 51420 <at> debbugs.gnu.org and Jim Porter <jporterbugs <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 27 Oct 2021 13:56:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 25 Nov 2021 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 209 days ago.

Previous Next


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