From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: What's missing in ELisp that makes people want to use cl-lib? Date: Tue, 14 Nov 2023 04:48:11 +0200 Message-ID: <21812c70-0d5b-a7fc-d858-95e0611ebefd@gutov.dev> References: <8734xetjkk.fsf@yahoo.com> <87cywhsrcf.fsf@yahoo.com> <87cywgx1z0.fsf@web.de> <83wmuowwp3.fsf@gnu.org> <8334xcwank.fsf@gnu.org> <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> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17105"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: =?UTF-8?Q?Gerd_M=c3=b6llmann?= , Eli Zaretskii , michael_heerdegen@web.de, emacs-devel@gnu.org To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 14 03:48:46 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 1r2jTp-0004Ca-In for ged-emacs-devel@m.gmane-mx.org; Tue, 14 Nov 2023 03:48:46 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r2jTW-0003tU-46; Mon, 13 Nov 2023 21:48:26 -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 1r2jTT-0003rh-B9 for emacs-devel@gnu.org; Mon, 13 Nov 2023 21:48:23 -0500 Original-Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r2jTM-0005v0-LK; Mon, 13 Nov 2023 21:48:22 -0500 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 70F8F3202092; Mon, 13 Nov 2023 21:48:14 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 13 Nov 2023 21:48:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1699930093; x=1700016493; bh=bCFhgsYT1M4uPNER46xglDu3Ol9PTlhCbgL vv4qgOvE=; b=MDaMujq93I137KeNm727FkP/XlzCbFyhIUbvv/y+PeUluIrVml4 0b/dWZ+P5T1j4pIpRvNPQ3X+pwvyHRbgFkQQGWCRKcmosnb6Z/NBgiCVIXtLm58n XE7qaaurzFW/QLT1qsYm8X8Lj69kozWCYn1kJZhbjKZvg2uxLRjjq6QKUs0QSzkK wCsnq56YvnC/NBB3xdJm+wTtC71GDCAhCJ7ySUREchjVjoqvPfyO6vfQvxdET2sl LQ0XyzJQf215GvHm0gZ+L/Aum8F3ZmbEEAkyTprEjTnKSIhi/mY8cmpZpaSyL5BJ +rF4q7yBif3K/DGWPkaeTIQ3YSlGklmV/rA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1699930093; x=1700016493; bh=bCFhgsYT1M4uPNER46xglDu3Ol9PTlhCbgL vv4qgOvE=; b=b7+yfUlhjnAJSVn/5xdKsxm6XUgn2ykN612g1VilE8Ohj7eS8Pm ICaU1ztM+e7ngUbWFGJRdYRN379Uulq8CAgB289YcZNYbf+xYIfgR12V8fYCzneT XpfFBcBTpf9JzXdf72AajQG4UNn4QWMYZu6HdTEq9EJ5ZBonQA5OTBa1tx/oBmrT krNgns9O0UnkiYIJUen6fPu/Qr7E30NXUopcP1TeLw7NxNH/mK2SS/7r1FsuE7K3 NnVqbhfCNt1nN1a6e3BuHZDC2zXi1g6gn+ipo4ouLLibRBVIFmOBfL1ZPNn2UZbf qyCYtBwNmN3E0fDMwDljOeEHZBSo6FiazqQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudefuddghedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfffheeljeffgeffueeghfekkedtfffgheejvdegjeettdduheeufffggfef jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 13 Nov 2023 21:48:12 -0500 (EST) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=64.147.123.24; envelope-from=dmitry@gutov.dev; helo=wout1-smtp.messagingengine.com X-Spam_score_int: -67 X-Spam_score: -6.8 X-Spam_bar: ------ X-Spam_report: (-6.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-3.971, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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:312709 Archived-At: On 14/11/2023 04:44, João Távora wrote: > > On Tue, Nov 14, 2023 at 2:27 AM João Távora > wrote: > > > > The case in the CL world against generic functions' performance > is often not that the dispatch is slow, but that > > > That said, it still matters, of course.  Here's your non-destructive > seq-difference-3 but with many small lists: > > (setq cc (make-list 12 "blabla")) > (setq list2 (make-list 12 "shooveedoowaa")) > ;; (4.225398191 31 2.3103362619999928) > (benchmark-run 1000000 (cl-set-difference cc list2 :test #'equal)) > > ;; (6.959332908 56 4.235225837999991) > (benchmark-run 1000000 (seq-difference-3 cc list2)) And if the list has just 1 element (or zero?), the gap would be even larger. Yes, generic dispatch has a cost. Only seeing a 1.6x difference here is a nice surprise, actually. > And of course the destructive version still wins by 10x > > ;; (0.676608019 4 0.26997238299998116) > (benchmark-run 1000000 (cl-nset-difference cc list2 :test #'equal)) No doubt.