From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Konstantin Kharlamov Newsgroups: gmane.emacs.bugs Subject: bug#69108: false-positive warning "variable =?UTF-8?Q?=E2=80=98=5F=E2=80=99?= not left unused" in if-let* and if-let Date: Sat, 17 Feb 2024 13:09:21 +0300 Message-ID: References: <87il2ryi30.fsf@web.de> <87mss09bnc.fsf@web.de> <86eddbv7no.fsf@gnu.org> <78798be7b3bc7a7bb477d4ec952734b199588d00.camel@yandex.ru> <878r3jz545.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39982"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.50.3 Cc: Michael Heerdegen , Eli Zaretskii , 69108@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 17 11:10:05 2024 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 1rbHe1-000ACc-It for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Feb 2024 11:10:05 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rbHdh-00083u-Cg; Sat, 17 Feb 2024 05:09:45 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rbHdf-00083L-AI for bug-gnu-emacs@gnu.org; Sat, 17 Feb 2024 05:09:43 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rbHdf-00071j-2B for bug-gnu-emacs@gnu.org; Sat, 17 Feb 2024 05:09:43 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rbHdy-0000T8-GP for bug-gnu-emacs@gnu.org; Sat, 17 Feb 2024 05:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Konstantin Kharlamov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Feb 2024 10:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69108 X-GNU-PR-Package: emacs Original-Received: via spool by 69108-submit@debbugs.gnu.org id=B69108.17081645921782 (code B ref 69108); Sat, 17 Feb 2024 10:10:02 +0000 Original-Received: (at 69108) by debbugs.gnu.org; 17 Feb 2024 10:09:52 +0000 Original-Received: from localhost ([127.0.0.1]:60483 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbHdm-0000Se-Rj for submit@debbugs.gnu.org; Sat, 17 Feb 2024 05:09:52 -0500 Original-Received: from forward500b.mail.yandex.net ([178.154.239.144]:50020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbHdh-0000SJ-7k for 69108@debbugs.gnu.org; Sat, 17 Feb 2024 05:09:49 -0500 Original-Received: from mail-nwsmtp-smtp-production-main-84.iva.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-84.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:4816:0:640:cd71:0]) by forward500b.mail.yandex.net (Yandex) with ESMTPS id E118360F4A; Sat, 17 Feb 2024 13:09:22 +0300 (MSK) Original-Received: by mail-nwsmtp-smtp-production-main-84.iva.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id L9Lgd7IOkOs0-scQzvBDq; Sat, 17 Feb 2024 13:09:22 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1708164562; bh=xklU1LtUnG94LS/ewlGbZpCrGdgihUTCoMyqNbMdqcU=; h=References:Date:In-Reply-To:Cc:To:From:Subject:Message-ID; b=c5/fqx7lP9mU+dR0htL4UHda0EteCdydiOQJFQn76Km4Ns7Qjm5bbKd1wZV36C1lx Wr3ZPDnfcD0oVPsQJyqYRDCt8SZXq2dgxWt5Q3tcP9fGNAG7VhW+umg0dN/Hx0463W aYUa+/i2FvTXDxvEQuPH/AaUrVBrM2flYVsUAXS4= Authentication-Results: mail-nwsmtp-smtp-production-main-84.iva.yp-c.yandex.net; dkim=pass header.i=@yandex.ru In-Reply-To: <878r3jz545.fsf@localhost> 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:280124 Archived-At: On Sat, 2024-02-17 at 11:45 +0000, Ihor Radchenko wrote: > Konstantin Kharlamov writes: > > > Just a side note, from my experience pcase is very slow=C2=B9, so if a > > function supposed to be called often, I presume it's better to > > avoid > > `pcase`. Although, Idk how it compares to `cond`. But judging from > > the > > fact `cond` is implemented in C, it is likely faster. > > > > 1: > > https://github.com/ankurdave/color-identifiers-mode/commit/bc566bcdbd79= f230b35eafd2b6c4f8428402ec09 > > I very much doubt the assertion of that commit. > AFAIK, pcase expands to a similar consp check. If may be slow only > when > you macro-expand it during run time, not byte-compiling the code > during > benchmark. I recommend `benchmark-run-compiled' for testing. Or even > to > use native-compilation. Sure, I just re-tested with `benchmark-run-compiled` and the result is simi= lar. Here's what I do: 1. In color-identifers repo `git checkout bc566bcdbd79f230b35eafd2b6c4f8428= 402ec09` 2. Open a `emacs ./color-identifiers-mode.el` 3. Now, I don't know for sure if `benchmark-run-compiled` compiles child fu= nctions or not. But just to be on the safe side I merged the two functions, so: 1. Inside function `color-identifiers:elisp-get-declarations` remove the= call `(color-identifiers:elisp-declarations-in-sexp sexp result)` 2. Copy the body of `color-identifiers:elisp-declarations-in-sexp` start= ing with the first `(let)` call and paste it in place where we removed the cal= l. 4. Evaluate `color-identifiers:elisp-get-declarations` 5. Open Emacs's `simple.el` 6. Evaluate `(benchmark-run-compiled 1 (color-identifiers:elisp-get-declara= tions))` Results for 3 times are (this is another laptop, so numbers are a bit di= fferent): (2.0673167670000003 54 1.316455474999998) (2.0684198769999997 54 1.3043319699999998) (2.079789413 54 1.3183175779999985) 7. Undo code changes and call `git checkout HEAD^` to test code prior to th= e commit 8. Repeat 3 and 4 9. Evaluate `(benchmark-run-compiled 1 (color-identifiers:elisp-get-declara= tions))`. Results for 3 times are: (5.194122174 135 3.313309744999998) (5.130884611 135 3.2485326989999948) (5.155663089 134 3.2561076369999995)