From unknown Sat Jun 14 19:28:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49579: 28.0.50; [PATCH] Faster describe-mode Resent-From: Ori Barbut Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Jul 2021 16:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49579 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 49579@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.162636766919453 (code B ref -1); Thu, 15 Jul 2021 16:48:01 +0000 Received: (at submit) by debbugs.gnu.org; 15 Jul 2021 16:47:49 +0000 Received: from localhost ([127.0.0.1]:49578 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m44WX-00053b-Ar for submit@debbugs.gnu.org; Thu, 15 Jul 2021 12:47:48 -0400 Received: from lists.gnu.org ([209.51.188.17]:57878) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m44WU-00053T-CY for submit@debbugs.gnu.org; Thu, 15 Jul 2021 12:47:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55578) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m44WT-0001hc-Uj for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2021 12:47:42 -0400 Received: from mail-qv1-xf29.google.com ([2607:f8b0:4864:20::f29]:40854) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m44WS-0006ek-6A for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2021 12:47:41 -0400 Received: by mail-qv1-xf29.google.com with SMTP id p10so3160178qvk.7 for ; Thu, 15 Jul 2021 09:47:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oribarbut-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version; bh=OCAWjsRBgeSQx9vZe5nnaU8l/41gZqWEfKW1nDP2NFQ=; b=KKXabFiWwkMCY7lqPVPLma+E5P8F6vcaekQB2x3UGFAAnJD4M2NsvS/osPpOYATgdA g8YYqjyduy3iyggC+bzwEiAtHfhX0JN/ZIO+z4qAqIDPqvvlzuL877voBE65Eqc/vuF7 GUYXfTc4rzCtWt0sD1QBTPbX4E9WKLwROCJEZzvYchXG6FpXSL203+dUPmM6eUbuz81T +c/tRsp34mPDmJpdmMdtdrfugAx5u8hA8+Hmy0HHVMg2aeJ6ieBWUwq2/aVK026Gltgs MnhLPg9+IM8cgPVbxkTeu2hTMXVt7TpfYbLmHdQpOSYEbfu3of/ajbbh7XWi85qMO6VM icng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version; bh=OCAWjsRBgeSQx9vZe5nnaU8l/41gZqWEfKW1nDP2NFQ=; b=qpH5KlaUrfL/2Y5TB2BTKGiYbfz6gaMcsUQnzSHgHerixjb2bR7BTWZQoXlYHwR3pw 1uF33WgBUlc6KBvk1Xl7l+4k3n9CtP2FzzMD9uQctQ0ELW7sJFZfZ1Cz1+gqvIYqUUNm m6ezZv3LBqLLC+siuEfvXvG/4LvFsqiKUC/xryvhDlWsORT46kSb6JQj7S0xuGk4Owkb mE/TtSBIYVj6+JzgQ5MuKavCdCIPNoxEl/uXoY7EAjnNqJFXbV/NirWcivNVCwVy46/K 5i2iQMOSSCekgLfzBbe9U0TUExNmCa6ILe7hYAG2Ioy1g0XAnQucWQgzu/wDdmmHv0NN ByjA== X-Gm-Message-State: AOAM530utVaYLFYe5EkrlFzAdiQR+uMPr/uBGW38Y01W4nPK6K8F71kM tsxGnifLRlEViP82PXarOAuJyg== X-Google-Smtp-Source: ABdhPJzJERkFvmA/fKbmzjojx98G6KU4FvDcjsxopoeu95Kst59hgsAc/DjpkwY6Y/fMVLaguxwIhQ== X-Received: by 2002:a0c:e7c9:: with SMTP id c9mr5457219qvo.47.1626367658553; Thu, 15 Jul 2021 09:47:38 -0700 (PDT) Received: from oribarbut.com (96-127-247-73.qc.dsl.ebox.net. [96.127.247.73]) by smtp.gmail.com with ESMTPSA id u11sm2745788qkk.72.2021.07.15.09.47.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jul 2021 09:47:38 -0700 (PDT) Received: by oribarbut.com (Postfix, from userid 1000) id 1F10D220FA8; Thu, 15 Jul 2021 12:47:36 -0400 (EDT) From: Ori Barbut Date: Thu, 15 Jul 2021 12:47:36 -0400 Message-ID: <87eebzv80n.fsf@oribarbut.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::f29; envelope-from=ori@oribarbut.com; helo=mail-qv1-xf29.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-lisp-help-fns.el-Faster-describe-mode.patch Content-Description: Text Data >From d5531a6a1d68a0710c866cadfb75bb0a0ba00f98 Mon Sep 17 00:00:00 2001 From: Ori 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 --=-=-=-- From unknown Sat Jun 14 19:28:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#49579: 28.0.50; [PATCH] Faster describe-mode Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Jul 2021 16:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49579 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Ori Barbut Cc: 49579@debbugs.gnu.org Received: via spool by 49579-submit@debbugs.gnu.org id=B49579.162636830720501 (code B ref 49579); Thu, 15 Jul 2021 16:59:02 +0000 Received: (at 49579) by debbugs.gnu.org; 15 Jul 2021 16:58:27 +0000 Received: from localhost ([127.0.0.1]:49589 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m44gt-0005Kb-9w for submit@debbugs.gnu.org; Thu, 15 Jul 2021 12:58:27 -0400 Received: from quimby.gnus.org ([95.216.78.240]:59022) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m44gr-0005KJ-GH for 49579@debbugs.gnu.org; Thu, 15 Jul 2021 12:58:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=O70h8IEVuIbcOf9lkeRi0EWPHJG/sTHs+5fSmXNL5hc=; b=j+CQ4ROKCsTItl1uHKJsDxUyZG wmSj2fEsswCaigWTksEbk/YIf+7cG/GLRpaTXcfDxkDTICWGHc8EzkyhrZ85DWSSDs/RtN5g3DDCY 5dxtM2PU3ZVSQJCXQIbM4Ukhrh0C0fZ1+s9s4RUWt0jY6f7rsRmr+YSfN/bFLQ6p3zAc=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m44gi-0002j5-BC; Thu, 15 Jul 2021 18:58:18 +0200 From: Lars Ingebrigtsen References: <87eebzv80n.fsf@oribarbut.com> X-Now-Playing: Vert's _Broken Breakbeat Bebop_: "Cherry Phosphate" Date: Thu, 15 Jul 2021 18:58:15 +0200 In-Reply-To: <87eebzv80n.fsf@oribarbut.com> (Ori Barbut's message of "Thu, 15 Jul 2021 12:47:36 -0400") Message-ID: <87wnprh5ug.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Ori Barbut 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 t [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ori Barbut 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 From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 15 12:58:35 2021 Received: (at control) by debbugs.gnu.org; 15 Jul 2021 16:58:35 +0000 Received: from localhost ([127.0.0.1]:49592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m44h1-0005Kw-Gk for submit@debbugs.gnu.org; Thu, 15 Jul 2021 12:58:35 -0400 Received: from quimby.gnus.org ([95.216.78.240]:59046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m44h0-0005Kj-Fg for control@debbugs.gnu.org; Thu, 15 Jul 2021 12:58:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=GWUr+sNMHysyVUH5s7kCSlEumEXnObe9ExxyNbrup+s=; b=j4bqFhlFaCe3S7MI3JUVZxPow3 Phpf4L3fbJsJ4ntofjSKSPVOGloeByAJG6SzSmS4nk3okv6kv27xQkrVb4ABSsqMtaKGxOaFkBz79 VDGh7xjXFDefMF+OmDB9KLVxTpUBuDKnouTrVQMMqUg9Fcvtb3+vecfowcUf+zKGddYE=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m44gr-0002jJ-Qq for control@debbugs.gnu.org; Thu, 15 Jul 2021 18:58:28 +0200 Date: Thu, 15 Jul 2021 18:58:25 +0200 Message-Id: <87v95bh5u6.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #49579 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 49579 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 49579 28.1 quit