emacs-devel
[Top][All Lists]
Advanced

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

Re: ido-switch-buffer is slow with many buffers; others are fast


From: Spencer Baugh
Subject: Re: ido-switch-buffer is slow with many buffers; others are fast
Date: Sat, 14 Nov 2020 19:19:27 -0500

Dmitry Gutov <dgutov@yandex.ru> writes:
> On 14.11.2020 18:34, catern@catern.com wrote:
>> I recently became annoyed enough in my 1000-buffer Emacs instance to
>> start profiling things.
>> 
>> I was disappointed to find that the buffer-switching slowness I'd seen
>> is the fault of ido-switch-buffer.
>> 
>> ido-switch-buffer takes over a second before it starts accepting user
>> input, with this many buffers.
>
> Which Emacs version are you using?
>
> A fix that seems relevant has been added in df4991093b9 recently. But 
> it's only in Emacs 28 thus far.

Oh, indeed, that seems perfect! So, forget everything I said before -
this fixes ido's performance to be quite fine with large numbers of
buffers. So that specific problem is solved.

The associated bug#41029 mentions:
>Many of the buffer locals (in particular I think it's the
>SYMBOL_FORWARDED types --- my terminoly may be off), appear to be O(n)
>to bind, where n is the number of live buffers.

That's quite worrying - that implies that pretty much any code will run
slower as the number of buffers increases, even if it doesn't have
anything to do with buffers! This explains the slow performance of
let-binding case-fold-search that I mentioned in another branch of this
thread.

Is this poor scaling of binding buffer locals a known problem? Has
anyone worked on fixing this?




reply via email to

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