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.

Full log


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)]

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

Previous Next


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