bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#66117: 30.0.50; `find-buffer-visiting' is slow when opening large nu


From: Eli Zaretskii
Subject: bug#66117: 30.0.50; `find-buffer-visiting' is slow when opening large number of buffers
Date: Fri, 22 Sep 2023 17:57:30 +0300

> From: Ihor Radchenko <yantar92@posteo.net>
> Cc: dmitry@gutov.dev, 66117@debbugs.gnu.org
> Date: Fri, 22 Sep 2023 13:30:41 +0000
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> Will it be acceptable to implement the cache using variable watchers?
> >
> > I don't like us using variable watchers for such stuff.
> >
> > Why cannot we just cache the correspondence between files and buffers
> > in some hash-table?
> 
> Because `buffer-file-name' can be modified from Lisp (via
> `set-visited-file-name' or directly). Same for `buffer-file-truename'
> and `buffer-file-number'.

You could update the cache in set-visited-file-name, and ignore
direct changes.

> Or should we just assume that these variables remain unchanged other
> than by primitives?

Programs that make these changes are asking for trouble, IMO.  AFAICT,
find-buffer-visiting will never find such buffers anyway.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]