From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: What's missing in ELisp that makes people want to use cl-lib? Date: Thu, 16 Nov 2023 17:02:09 +0100 Message-ID: <87jzqhlm9q.fsf@web.de> References: <320999cc-6c83-2315-0044-cc0403400af3@gutov.dev> <9ab5d2bd-a648-cae0-a4a7-ae86be10af0f@gutov.dev> <87r0kuqxbf.fsf@gmail.com> <54e115a2-fc36-3056-a030-0dbf32416ddb@gutov.dev> <43f290b0-4119-597b-c89a-0fb4c7db1665@gutov.dev> <1e7fe1ef-af7d-3222-7b9e-b569b3c97ccf@gutov.dev> <22e4cb4d-a8f3-1530-881d-b8c59c5d969b@gutov.dev> <339b58d6-5a44-8393-c2cd-4c935147dde3@gutov.dev> <877cmhrcsf.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23740"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: emacs-devel@gnu.org Cancel-Lock: sha1:WQny9R6jn13wP5MCJ+01P7QqDwk= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 16 17:02:48 2023 Return-path: Envelope-to: ged-emacs-devel@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 1r3epM-00062E-NY for ged-emacs-devel@m.gmane-mx.org; Thu, 16 Nov 2023 17:02:48 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3eog-0004o8-4X; Thu, 16 Nov 2023 11:02:06 -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 1r3eof-0004nz-4Z for emacs-devel@gnu.org; Thu, 16 Nov 2023 11:02:05 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r3eod-0004WY-K9 for emacs-devel@gnu.org; Thu, 16 Nov 2023 11:02:04 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1r3eob-0004x3-N2 for emacs-devel@gnu.org; Thu, 16 Nov 2023 17:02:01 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:312809 Archived-At: João Távora writes: > But this one stands out. I hope you can read this macro more or less. > > (joaot/with-benchmark-group "destructuring" > ((list1 . (make-list 3 0))) > 100000 > (joaot/bench (pcase-let ((`(,a ,b ,c) list1)) (+ a b c))) > (joaot/bench (cl-destructuring-bind (a b c) list1 (+ a b c))) > (joaot/bench (seq-let (a b c) list1 (+ a b c)))) > > Running in Emacs -Q: > > ("destructuring" > (cl-destructuring-bind "FASTEST" 0.010702393 0 0.0) > (pcase-let "1.3x SLOWER" 0.014360937999999998 0 0.0) > (seq-let "3.5x (rel 2.6x) SLOWER" 0.03706726 0 0.0)) > > Where after loading m6sparse.el we go to this: > > (("destructuring" (cl-destructuring-bind "FASTEST" 0.010157632 0 0.0) > (pcase-let "1.3x SLOWER" 0.013152518000000002 0 0.0) > (seq-let "14.8x (rel 11.4x) SLOWER" 0.15057331499999999 > 6 0.04785139399999849)) Isn't seq-let directly translated into a pcase-let call (it's a simplistic macro)? How is this possible? Michael.