From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#44529: [PATCH] Convert apropos-internal from C to Lisp Date: Mon, 09 Nov 2020 18:02:00 +0200 Message-ID: <83tuty4iyv.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35050"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 44529@debbugs.gnu.org, monnier@iro.umontreal.ca To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 09 17:04:06 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kc9eG-0008zA-WC for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 09 Nov 2020 17:04:05 +0100 Original-Received: from localhost ([::1]:56730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kc9eG-000169-2X for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 09 Nov 2020 11:04:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41792) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kc9dG-0000MY-D6 for bug-gnu-emacs@gnu.org; Mon, 09 Nov 2020 11:03:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51989) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kc9dG-00012d-3e for bug-gnu-emacs@gnu.org; Mon, 09 Nov 2020 11:03:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kc9dG-0008KR-1N for bug-gnu-emacs@gnu.org; Mon, 09 Nov 2020 11:03:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Nov 2020 16:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44529 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 44529-submit@debbugs.gnu.org id=B44529.160493772530386 (code B ref 44529); Mon, 09 Nov 2020 16:03:01 +0000 Original-Received: (at 44529) by debbugs.gnu.org; 9 Nov 2020 16:02:05 +0000 Original-Received: from localhost ([127.0.0.1]:35295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kc9cK-0007tp-Qq for submit@debbugs.gnu.org; Mon, 09 Nov 2020 11:02:05 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:41468) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kc9cJ-0007o4-Jw for 44529@debbugs.gnu.org; Mon, 09 Nov 2020 11:02:04 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:45765) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kc9cD-0000hZ-L8; Mon, 09 Nov 2020 11:01:57 -0500 Original-Received: from [176.228.60.248] (port=4857 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kc9cB-0000r9-73; Mon, 09 Nov 2020 11:01:56 -0500 In-Reply-To: (message from Stefan Kangas on Mon, 9 Nov 2020 02:38:59 -0800) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:192947 Archived-At: > From: Stefan Kangas > Date: Mon, 9 Nov 2020 02:38:59 -0800 > Cc: monnier@iro.umontreal.ca > > > I discovered that apropos-internal is defined in keymap.c for a reason > > that escapes me (it really should be moved to apropos.el). > > Yes. So I was actually going to propose the attached patch. In my > testing, it is as fast as the C version (especially when byte-compiled), > which would match my intuition from reading the code. > > (benchmark-run 10 > (apropos-command "test")) > => (0.12032415399999999 2 0.014772391999999995) ; C > => (0.13513192100000002 2 0.017216643000000004) ; Lisp > > (benchmark-run 10 > (apropos "x")) > => (3.846117816 131 1.092690677) ; C > => (4.218219444 145 1.2153865740000003) ; Lisp 20% slowdown is not negligible, at least not in principle. Let's wait for more people to voice their opinions on this aspect. > Any comments or objections? A bother: apropos.el is not preloaded, so please double-check that none of the preloaded files call apropos-internal, otherwise that would mean we need to preload apropos.el, which I think is undesirable. Thanks.