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


Message #62 received at 66117 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Ihor Radchenko <yantar92 <at> posteo.net>
Cc: dmitry <at> gutov.dev, Eli Zaretskii <eliz <at> gnu.org>, 66117 <at> debbugs.gnu.org
Subject: Re: bug#66117: 30.0.50; `find-buffer-visiting' is slow when opening
 large number of buffers
Date: Tue, 26 Sep 2023 16:18:12 +0200
Ihor Radchenko <yantar92 <at> posteo.net> writes:

Hi Ihor,

>> With local files, it seems like insert-file-contents sets it.  So
>> maybe we should record the file name in the cache in bset_filename.
>
> Thanks for the pointer!
> AFAIU, the relevant code is
>
>       if (NILP (handler))
> 	{
> 	  current_buffer->modtime = mtime;
> 	  current_buffer->modtime_size = st.st_size;
> 	  bset_filename (current_buffer, orig_filename);
>
> However, it looks like file handlers are responsible for setting the
> filename. So,
>
> 	 >   - ~tramp-handle-insert-file-contents~
> 	 >   - ~tramp-archive-handle-insert-file-contents~
> 	 >   - ~ange-ftp-insert-file-contents~
> 	 >   - ~jka-compr-insert-file-contents~
> 	 >   - ~mm-url-insert-file-contents~
> 	 >   - ~epa-file-insert-file-contents~
>
> may also need to handle the caching. And also all the third-party handlers.

That might be hard to synchronize. Why not fill the cache after that
code snippet? The handlers have already done their job, buffer-file-name
is set. And so does bset_filename in the local case.

Best regards, Michael.




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.