* bug#49579: 28.0.50; [PATCH] Faster describe-mode
@ 2021-07-15 16:47 Ori Barbut
2021-07-15 16:58 ` Lars Ingebrigtsen
0 siblings, 1 reply; 2+ messages in thread
From: Ori Barbut @ 2021-07-15 16:47 UTC (permalink / raw)
To: 49579
[-- Attachment #1: Type: text/plain, Size: 240 bytes --]
Hi team,
This is a small improvement to a predicate that is called often when
one calls describe-mode. For a large configuration gives a noticable speed
boost; in my simple test it went from 7s to 0.4s to run describe-mode.
Thanks,
Ori
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Text Data --]
[-- Type: text/x-diff, Size: 1236 bytes --]
From d5531a6a1d68a0710c866cadfb75bb0a0ba00f98 Mon Sep 17 00:00:00 2001
From: Ori <ori@oribarbut.com>
Date: Thu, 15 Jul 2021 12:25:10 -0400
Subject: [PATCH] ; * lisp/help-fns.el: Faster describe-mode
A predicate checks if there are no key bindings for a given function. A
full list of bindings is not needed, even a single binding is sufficient
to say the function is bound. Set FIRSTONLY arg in where-is-internal so
this predicate runs faster, with functional equivalence. For some
configurations this has a noticeable improvement on the speed of
describe-mode.
Copyright-paperwork-exempt: yes
---
lisp/help-fns.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index afdb0d17b2..835d20f5f2 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -1901,7 +1901,7 @@ help-fns--list-local-commands
;; Ignore aliases.
(not (symbolp (symbol-function sym)))
;; Ignore everything bound.
- (not (where-is-internal sym))
+ (not (where-is-internal sym nil t))
(apply #'derived-mode-p (command-modes sym)))
(push sym functions))))
(with-temp-buffer
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* bug#49579: 28.0.50; [PATCH] Faster describe-mode
2021-07-15 16:47 bug#49579: 28.0.50; [PATCH] Faster describe-mode Ori Barbut
@ 2021-07-15 16:58 ` Lars Ingebrigtsen
0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2021-07-15 16:58 UTC (permalink / raw)
To: Ori Barbut; +Cc: 49579
Ori Barbut <ori@oribarbut.com> writes:
> This is a small improvement to a predicate that is called often when
> one calls describe-mode. For a large configuration gives a noticable speed
> boost; in my simple test it went from 7s to 0.4s to run describe-mode.
Cool; very nice. Applied to Emacs 28.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-07-15 16:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15 16:47 bug#49579: 28.0.50; [PATCH] Faster describe-mode Ori Barbut
2021-07-15 16:58 ` Lars Ingebrigtsen
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).