emacs-devel
[Top][All Lists]
Advanced

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

Re: fix for bug 10994 breaks ido customizations in major way


From: Óscar Fuentes
Subject: Re: fix for bug 10994 breaks ido customizations in major way
Date: Sun, 05 May 2013 15:38:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Leo Liu <address@hidden> writes:

> On 2013-05-05 20:20 +0800, Óscar Fuentes wrote:
>> Starting with 10000 candidates, ido flex matching enabled and flx
>> disabled, I see no responsiveness degradation while randomly typing
>> chars.
>
> In my emacs -q, eval the following:
>
> (let ((choices))
>   (mapatoms (lambda (a)
>               (when (or (boundp a) (fboundp a))
>               (push (symbol-name a) choices))))
>   (benchmark-run 10 (delete-dups choices)))
>
> gives me: (19.909896999999997 0 0.0)
>
> So on average there is 2 seconds delay in a MacBook with 2.0G x 2 CPU.
>
> CHOICES is 10321 long in my case.

I ran your test code on my Emacs session and the result was

(126.326822296 0 0.0)

being `choices' 26959 items long, which is fairly consistent with your
observations and with the O(n^2) complexity of delete-dups. However,
executing ido-completing-read with a list of 10530 strings (without
duplicates and on a CPU that seems to be similar to yours on
performance) takes 0.72 seconds, which is way faster than the 2 seconds
you observe for the list of symbols of similar size. So it seems that
delete-dups is faster for strings than symbols.

I agree that using delete-dups is not the ideal solution due to
performance concerns, but the current state breaks a quite convenient
usage pattern (i.e. use text properties for carrying extra information
about candidates) on a way that renders the machine to its knees.

IMHO incurring a performance penalty on huge lists is well worth the
pain in this case.



reply via email to

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