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: Dmitry Gutov
Subject: bug#66117: 30.0.50; `find-buffer-visiting' is slow when opening large number of buffers
Date: Tue, 12 Dec 2023 21:10:13 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

On 12/12/2023 20:36, Eli Zaretskii wrote:
From: Ihor Radchenko<yantar92@posteo.net>
Cc:monnier@iro.umontreal.ca,dmitry@gutov.dev,66117@debbugs.gnu.org
Date: Tue, 12 Dec 2023 17:44:15 +0000

Eli Zaretskii<eliz@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, so it might be worth a try (with measurements).





reply via email to

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