From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#66117: 30.0.50; `find-buffer-visiting' is slow when opening large number of buffers Date: Sat, 30 Dec 2023 13:07:10 +0200 Message-ID: <83cyuo3q5d.fsf@gnu.org> References: <878r919qfh.fsf@localhost> <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> <83sf3te1tu.fsf@gnu.org> <87msu1qmqv.fsf@localhost> <83zfy1cgoa.fsf@gnu.org> <87le9lcg4e.fsf@localhost> <831qb578n2.fsf@gnu.org> <87zfxt3yfy.fsf@localhost> <83jzow3yf1.fsf@gnu.org> <83h6k03tpx.fsf@gnu.org> <83frzk3srq.fsf@gnu.org> <87frzkas96.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14215"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dmitry@gutov.dev, 66117@debbugs.gnu.org, monnier@iro.umontreal.ca To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 30 12:08:30 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 1rJXCf-0003Ub-RX for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Dec 2023 12:08:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rJXCH-00052D-Sa; Sat, 30 Dec 2023 06:08:05 -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 1rJXCE-000521-50 for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2023 06:08:02 -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 1rJXCD-0000Is-HD for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2023 06:08:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rJXCD-0003Cr-V6 for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2023 06:08:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Dec 2023 11:08: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.170393444912281 (code B ref 66117); Sat, 30 Dec 2023 11:08:01 +0000 Original-Received: (at 66117) by debbugs.gnu.org; 30 Dec 2023 11:07:29 +0000 Original-Received: from localhost ([127.0.0.1]:43185 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rJXBg-0003C1-Qw for submit@debbugs.gnu.org; Sat, 30 Dec 2023 06:07:29 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48736) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rJXBf-0003Bo-58 for 66117@debbugs.gnu.org; Sat, 30 Dec 2023 06:07:28 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rJXBZ-0000Cx-04; Sat, 30 Dec 2023 06:07:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=F2oWwH/zSHpzGfTyypK4WNnhtRCvO8N8eTNi4Cgp0Rw=; b=E/43uO/kxTvE 2HwGib224sGpLBB/JMBImBXMdjpOBhXwFITYRapugacSryfOHO6MAqmsMldEmRmpqZDa8g/JJKYgi o6KoWBxsqYEeL0KOFvo+VwVbRYhoU6umrjK/mBW2QzxbXbNpr7S6CEKTWm/annI698XrYNZOJR+Rl LlIFMCihWO7mCj4DMTzfSmVWvP/T6VNrTD7fDBecxpGOov2R+6INO5Vyk6+28fXzd/8CfDxPyz4pV 4bmTwP4D0VKqtJZsZILGsF01nVsGSMdHRG6hyCR2fGIyU1wrXC0DNe9b5Wh+qZTstZkseK/k4nBpj rKiQbeJ23OtyBiOmfdMHVw==; In-Reply-To: <87frzkas96.fsf@localhost> (message from Ihor Radchenko on Sat, 30 Dec 2023 10:39:49 +0000) 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:277077 Archived-At: > From: Ihor Radchenko > Cc: dmitry@gutov.dev, 66117@debbugs.gnu.org, monnier@iro.umontreal.ca > Date: Sat, 30 Dec 2023 10:39:49 +0000 > > Eli Zaretskii writes: > > > I think at least part of the problem is in this fragment from > > find-file-noselect: > > > > ;; Find any buffer for a file that has same truename. > > (other (and (not buf) > > (find-buffer-visiting > > filename > > ;; We want to filter out buffers that we've > > ;; visited via symlinks and the like, where > > ;; the symlink no longer exists. > > (lambda (buffer) > > (let ((file (buffer-local-value > > 'buffer-file-name buffer))) > > (and file (file-exists-p file)))))))) > > Not this one - (and file ...) will never trigger when file is nil. Granted, that call to file-exists-p was not what I meant. > I think I found the problem - it is rather silly. > See the attached patch. Thanks, installed.