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.bugs Subject: bug#66117: 30.0.50; `find-buffer-visiting' is slow when opening large number of buffers Date: Tue, 12 Dec 2023 21:10:13 +0200 Message-ID: <0bbb45af-cca9-442a-837d-a173f7156248@gutov.dev> References: <878r919qfh.fsf@localhost> <87pm2584oz.fsf@localhost> <83cyy11ln1.fsf@gnu.org> <87lecp84mf.fsf@localhost> <83ttrdx8j9.fsf@gnu.org> <87a5su261p.fsf@localhost> <838r8e24yy.fsf@gnu.org> <87y1gezspg.fsf@localhost> <834jj21z05.fsf@gnu.org> <87il7izo4l.fsf@localhost> <831qe61xrh.fsf@gnu.org> <87cyxqzmhh.fsf@localhost> <83zg0uzlgw.fsf@gnu.org> <87v8bhxzcu.fsf@localhost> <83y1gdxws8.fsf@gnu.org> <87jzrwm7ul.fsf@localhost> <87h6n0m781.fsf@localhost> <87v8935wik.fsf@localhost> <83msuftr0i.fsf@gnu.org> <87plzbxtxa.fsf@localhost> <83fs07tjre.fsf@gnu.org> <87msufxqmo.fsf@localhost> <83a5qftghr.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13155"; 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: 66117@debbugs.gnu.org, monnier@iro.umontreal.ca To: Eli Zaretskii , Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 12 20:11:08 2023 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 1rD89q-0003CC-VC for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 Dec 2023 20:11:08 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rD89Z-0005Lw-5a; Tue, 12 Dec 2023 14:10:49 -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 1rD89X-0005Lo-Uu for bug-gnu-emacs@gnu.org; Tue, 12 Dec 2023 14:10:47 -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 1rD89X-00054l-NH for bug-gnu-emacs@gnu.org; Tue, 12 Dec 2023 14:10:47 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rD89m-0005rP-Jn for bug-gnu-emacs@gnu.org; Tue, 12 Dec 2023 14:11:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Dec 2023 19:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66117 X-GNU-PR-Package: emacs Original-Received: via spool by 66117-submit@debbugs.gnu.org id=B66117.170240824322501 (code B ref 66117); Tue, 12 Dec 2023 19:11:02 +0000 Original-Received: (at 66117) by debbugs.gnu.org; 12 Dec 2023 19:10:43 +0000 Original-Received: from localhost ([127.0.0.1]:57567 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rD89S-0005qq-K2 for submit@debbugs.gnu.org; Tue, 12 Dec 2023 14:10:42 -0500 Original-Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:51879) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rD89Q-0005qc-2y for 66117@debbugs.gnu.org; Tue, 12 Dec 2023 14:10:40 -0500 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 492283200BB8; Tue, 12 Dec 2023 14:10:18 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 12 Dec 2023 14:10:18 -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:subject:subject:to:to; s=fm3; t=1702408217; x=1702494617; bh=m0LJFOiWL0P4PEXZcOhpUbot9kSDskRmgcshqPJwWJU=; b= ydQy9vq/5Y4k8v9QGUhKkrigVkYARgKA2cfYihoXjwm6Fan10teasSuLg4vC0QSr bI+zgPtBIVPwFzUV4T46sAR9PpUYM3C+IDIo5xmCl94rD+JYDfbRV9cMy4NZblE+ bdEMxHWFI9BWMyGtYF0BnN/g9cUmI0JPl5T497zpCrvCGIEoMPYsBaqV+wKeH0Wy aGwaU+A+KqdEcHCTbUstD2IjSlBX3eC3ex7se6um2Aw5h2fqDRSneZzmG8mE9wV+ pj2gZYkFTZPz3Tg/pPNpzKlJ9vgdMvDGnckMXI8auLIyqeWcAdAbKsdHEiaCOEGH DG88jY2h4HNnaC1enSh1Eg== 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:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1702408217; x= 1702494617; bh=m0LJFOiWL0P4PEXZcOhpUbot9kSDskRmgcshqPJwWJU=; b=z 4XckHIykuFV0lv/IhOWsSQxSPsAVPffq+SVdbFfDwXWY/6ZhXwkuUMGin2kmMDhV ciUyhx0JQ0S5OyGQQaGF6l1uuiixIvw0wj+eNc8Wxf75MJ4lFwmXUia3W7KaEulV OKpz1jtr+BNVdFvwQFTOR6/AsWzrOs6ztY2TEniUPyMF/mOtK8TI9B+/qpNG5E4e PSD9gjjHc+E3nYmSv11W6Pov8zv9UiIFPill3A1BYu6Q642vyBNUC5prWyvShx9p U9WUYUIuX2XMchLu1fatg1XDs2uW82oQdF4jDsqWiJYlaFlnzmOeIcG0UQvuNRfA y2Hnk2FZymhDoTstZy/og== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudelgedguddulecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrg htthgvrhhnpeeigfetveehveevffehledtueekieeikeeufeegudfgfeeghfdulefgfeev ledvveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Dec 2023 14:10:16 -0500 (EST) Content-Language: en-US In-Reply-To: <83a5qftghr.fsf@gnu.org> 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:276071 Archived-At: On 12/12/2023 20:36, Eli Zaretskii wrote: >> From: Ihor Radchenko >> Cc:monnier@iro.umontreal.ca,dmitry@gutov.dev,66117@debbugs.gnu.org >> Date: Tue, 12 Dec 2023 17:44:15 +0000 >> >> Eli Zaretskii writes: >> >>>> #define BVAR(buf, field) (buffer_overrides->field ## _ == UNSET ?\ >>>> (buf)->field ## _ :\ >>>> buffer_overrides->field ## _) >>>> >>>> and replace the loop with simply setting buffer_overrides slot. >>> So for starters, we make each BVAR more expensive, i.e. make Emacs >>> uniformly slower (because we call BVAR all over the place). >> Yes, although I do not believe that it will have large impact in >> practice. It is just an extra == comparison. > We've seen how similar extra comparisons slow down Emacs when we > introduced symbols-with-location. IMO, BVAR might be even more > expensive, since it is used much more frequently and widely. We also have dynamic variable bindings all over the place, so it might be worth a try (with measurements).