GNU bug report logs - #66117
30.0.50; `find-buffer-visiting' is slow when opening large number of buffers

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> posteo.net>

Date: Wed, 20 Sep 2023 08:53:02 UTC

Severity: minor

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ihor Radchenko <yantar92 <at> posteo.net>
Cc: dmitry <at> gutov.dev, 66117 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
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
> From: Ihor Radchenko <yantar92 <at> posteo.net>
> Cc: dmitry <at> gutov.dev, 66117 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
> Date: Sat, 30 Dec 2023 10:39:49 +0000
> 
> Eli Zaretskii <eliz <at> gnu.org> 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.




This bug report was last modified 1 year and 135 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.