bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#51420: 29.0.50; [PATCH] Be more efficient when checking for a matchi


From: Jim Porter
Subject: 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:18:05 -0700

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.

Attachment: 0001-Be-more-efficient-when-checking-for-a-matching-clien.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]