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 #187 received at 66117 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: yantar92 <at> posteo.net, monnier <at> iro.umontreal.ca, 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, 12 Dec 2023 21:16:45 +0200
> Date: Tue, 12 Dec 2023 21:10:13 +0200
> Cc: monnier <at> iro.umontreal.ca, 66117 <at> debbugs.gnu.org
> From: Dmitry Gutov <dmitry <at> gutov.dev>
> 
> On 12/12/2023 20:36, Eli Zaretskii wrote:
> >> From: Ihor Radchenko<yantar92 <at> posteo.net>
> >> Cc:monnier <at> iro.umontreal.ca,dmitry <at> gutov.dev,66117 <at> debbugs.gnu.org
> >> Date: Tue, 12 Dec 2023 17:44:15 +0000
> >>
> >> Eli Zaretskii<eliz <at> gnu.org>  writes:
> >>
> >>>>    #define BVAR(buf, field) (buffer_overrides->field ## _ == UNSET ?\
> >>>>                                (buf)->field ## _ :\
> >>>>                               buffer_overrides->field ## _)
> >>>>
> >>>>    and replace the loop with simply setting buffer_overrides slot.
> >>> So for starters, we make each BVAR more expensive, i.e. make Emacs
> >>> uniformly slower (because we call BVAR all over the place).
> >> Yes, although I do not believe that it will have large impact in
> >> practice. It is just an extra == comparison.
> > We've seen how similar extra comparisons slow down Emacs when we
> > introduced symbols-with-location.  IMO, BVAR might be even more
> > expensive, since it is used much more frequently and widely.
> 
> We also have dynamic variable bindings all over the place

But not all of them are special like case-fold-search.

> so it might be worth a try (with measurements).

I didn't say it isn't worth a try.




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

Previous Next


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