unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Óscar Fuentes" <ofv@wanadoo.es>
To: Leo Liu <sdl.web@gmail.com>
Cc: Le Wang <l26wang@gmail.com>, emacs-devel@gnu.org
Subject: Re: fix for bug 10994 breaks ido customizations in major way
Date: Sun, 05 May 2013 15:38:25 +0200	[thread overview]
Message-ID: <87mws9sg1a.fsf@wanadoo.es> (raw)
In-Reply-To: <m1ip2x4m8d.fsf@gmail.com> (Leo Liu's message of "Sun, 05 May 2013 20:58:26 +0800")

Leo Liu <sdl.web@gmail.com> 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	other threads:[~2013-05-05 13:38 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-02 17:57 fix for bug 10994 breaks ido customizations in major way Le Wang
2013-05-03  4:13 ` Leo Liu
2013-05-03 12:49   ` Le Wang
2013-05-03 20:33     ` Leo Liu
2013-05-04  7:00       ` Le Wang
2013-05-04  8:58         ` Óscar Fuentes
2013-05-04 13:00           ` Le Wang
2013-05-05 10:57             ` Óscar Fuentes
2013-05-05 11:39               ` Leo Liu
2013-05-05 12:20                 ` Óscar Fuentes
2013-05-05 12:58                   ` Leo Liu
2013-05-05 13:38                     ` Óscar Fuentes [this message]
2013-05-05 14:31                       ` Stephen J. Turnbull
2013-05-05 15:26                         ` Óscar Fuentes
2013-05-06 15:11                           ` Le Wang
2013-05-06 22:49         ` Vitalie Spinu
2013-05-07  1:01           ` Óscar Fuentes
2013-05-07  9:35           ` Le Wang
2013-05-07 10:26             ` Vitalie Spinu
2013-05-07 10:35               ` Óscar Fuentes
2013-05-07 14:49                 ` Le Wang
2013-05-07 21:18                   ` Stefan Monnier
2013-05-07 14:42               ` Le Wang
2013-05-07 14:44             ` Drew Adams
2013-05-07 14:47               ` Le Wang
2013-05-07 19:00                 ` Vitalie Spinu
2013-05-07 19:53                   ` Óscar Fuentes
2013-05-08  0:04                     ` Leo Liu
2013-05-08  0:35                       ` Le Wang
2013-05-08  3:10                         ` Leo Liu
2013-05-08  3:29                           ` Leo Liu
2013-05-08  4:49                             ` Leo Liu
2013-05-08  8:14                               ` Vitalie Spinu
2013-05-08  8:42                                 ` Leo Liu
2013-05-08 12:23                                   ` Le Wang
2013-05-08 14:29                                     ` Leo Liu
2013-05-08 20:56                                   ` Juri Linkov
2013-05-10  1:52                                     ` Leo Liu
2013-05-17  2:48                                     ` Leo Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mws9sg1a.fsf@wanadoo.es \
    --to=ofv@wanadoo.es \
    --cc=emacs-devel@gnu.org \
    --cc=l26wang@gmail.com \
    --cc=sdl.web@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).