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, 26 Sep 2023 14:11:06 +0300 Message-ID: References: <878r919qfh.fsf@localhost> <72c93fb0-bf3e-3dad-69c0-2147cfa40f57@gutov.dev> <875y42xyex.fsf@localhost> <87zg1ewfc2.fsf@localhost> <834jjm749q.fsf@gnu.org> <87cyyawd1a.fsf@localhost> <83pm2a5k85.fsf@gnu.org> <87wmwh2tae.fsf@localhost> <83zg1d468w.fsf@gnu.org> <87bkdr2651.fsf@localhost> <83pm273fc1.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="35961"; 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 To: Eli Zaretskii , Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 26 13:12:59 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 1ql5zt-00092g-R1 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 26 Sep 2023 13:12:59 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ql5yv-000763-5F; Tue, 26 Sep 2023 07:11:57 -0400 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 1ql5yn-000733-2m for bug-gnu-emacs@gnu.org; Tue, 26 Sep 2023 07:11:50 -0400 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 1ql5ym-0000wy-QZ for bug-gnu-emacs@gnu.org; Tue, 26 Sep 2023 07:11:48 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ql5yz-0003oJ-N3 for bug-gnu-emacs@gnu.org; Tue, 26 Sep 2023 07:12:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Sep 2023 11:12:01 +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.169572669214607 (code B ref 66117); Tue, 26 Sep 2023 11:12:01 +0000 Original-Received: (at 66117) by debbugs.gnu.org; 26 Sep 2023 11:11:32 +0000 Original-Received: from localhost ([127.0.0.1]:47436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ql5yV-0003nW-KD for submit@debbugs.gnu.org; Tue, 26 Sep 2023 07:11:31 -0400 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:55583) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ql5yR-0003nF-Ja for 66117@debbugs.gnu.org; Tue, 26 Sep 2023 07:11:29 -0400 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 6A3D25C00AC; Tue, 26 Sep 2023 07:11:09 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 26 Sep 2023 07:11:09 -0400 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=fm1; t= 1695726669; x=1695813069; bh=p/3pSGo5PApCsbL6Ln+bAkXiLsdL9xzxYVR LSiY47Xc=; b=VC7GxW88BTRreqE/mENbvotnnabR7YlkyemufqZlm9EXp1pRfT0 GEDwycVnK6Iyi7fdTWTJa64CkABe/+cXNup/98BwmiOhXk0WneUMblyKhnM3m67y bSghm3SqRbUYlkOXf1+rsDttn51vllhPGRcfa3e5kjrEe0r/92+H5wTWPuIIAsdY dG2OdL4WngS/k94ptKfTybALd2poyAUscQyqnrrCSOWVL+D1DAsiczP+4li5xyme 2A6DIlh74bY8pcadJPz1OB92DCzfpSK6u+KvEJgu3wPlXacHMtw9r2JGiIJQLVoN J5gKiu2gVsC2cbvVgC7mPFSaf46Hn6caabA== 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=fm2; t= 1695726669; x=1695813069; bh=p/3pSGo5PApCsbL6Ln+bAkXiLsdL9xzxYVR LSiY47Xc=; b=DXED0oCfQOcsW7z5rSCNoYGjYWeRBDlPG22ZMiH+uvy6sEeT4hx TVUHCOFUKA4IgsBP+U2LyRkuRy+sxOqOxVQRWCwRyPz27M8iyMYQIx0LxAGKtuQz bI5hpjOi2lE3PTxUdIanlGivi7LWq/RilWJrSd5Au1ZaSHG9N4MvLXdmt5Sv15nQ RVltyXXe3Oeb2DZdSoNfIt4ez+QNYGT8o/q8Te4NXl4hHBWjkKG5agnLW/3fYK+t i7aq5BcIBEJg1E8+Vuc6is+foJnO22M6CDntGMEveRUSgaITbZGgPUAgAbV+0P4r wZ8OH/5buqJPp/h+k5t1dP7l+4kYoTRImlw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvjedrtddtgddtkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeeigfetveehveevffehledtueekieeikeeufeegudfgfeeghfdulefgfeevledv veenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 26 Sep 2023 07:11:07 -0400 (EDT) Content-Language: en-US In-Reply-To: <83pm273fc1.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:271366 Archived-At: On 24/09/2023 15:50, Eli Zaretskii wrote: >>> ... if not, these functions are not relevant >>> to the issue at hand. If the search by truename_is_ significant, we >>> could cache that as well. >> Just to make sure that we are on the same page: the cache I am proposing >> should be complete - if a buffer is missing from the cache, we should be >> sure that there is no matching buffer. > Since we will keep buffer-list (we must), even with this cache > available, we can always leave the current code that scans the buffer > list if the name is not in the cache. This way, we don't need to > worry to have all the buffers in the cache, only those which are > looked for frequently and need the efficiency. If the cache was exhaustive (i.e. we could guarantee that 'find-buffer-visiting' is always fast), we could use it in Xref as well. Instead of doing the memoization dance in xref--find-file-buffer which still doesn't account for symlinks.