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: Michael Heerdegen
Subject: bug#66117: 30.0.50; `find-buffer-visiting' is slow when opening large number of buffers
Date: Thu, 28 Sep 2023 01:30:37 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Ihor Radchenko <yantar92@posteo.net> writes:

> So, using `with-current-buffer' when looping over all the buffers is
> certainly not optimal (maybe in other places as well).
>
> However, even `buffer-local-value' is still costly - it adds up over 50%
> run time.

OTOH - I tried to reproduce your experiments here locally -
`find-buffer-visiting' only takes 12% of the total run time here when
using the `buffer-local-value' tuned definition of `find-buffer-visiting'.

When we additionally merge the two loops in `find-buffer-visiting' into
one loop and avoid the duplicated calls of `buffer-local-value', don't we
reach a region where maintaining a separate cache doesn't make sense for
the additional gain?

And I wonder which part(s) of `buffer-local-value' is/are that costly,
and why.

Storing the same information twice - once in a buffer local variable,
and then again in a cache that needs to be updated separately doesn't
sound very reasonable.


Michael.





reply via email to

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