all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Óscar Fuentes" <ofv@wanadoo.es>
To: emacs-devel@gnu.org
Subject: Re: fix for bug 10994 breaks ido customizations in major way
Date: Sun, 05 May 2013 17:26:08 +0200	[thread overview]
Message-ID: <87ip2xsb1r.fsf@wanadoo.es> (raw)
In-Reply-To: 87y5btjy6v.fsf@uwakimon.sk.tsukuba.ac.jp

"Stephen J. Turnbull" <stephen@xemacs.org> writes:

> Óscar Fuentes writes:
>
>  > So it seems that delete-dups is faster for strings than symbols.
>
> My interpretation is different: something is broken in the benchmarks
> (or in the estimate that the CPUs are of comparable performance).

I estimated that the CPUs are of similar performance because Leo reports
2 seconds for 10321 items and here it takes 12.5 seconds for 27000
items. Then items count ratio is 27000/10321 = 2.6, time ratio is 12.5/2
= 6.25 and the expected time ratio given O(n^2) complexity for the same
CPU is 2.6^2 = 6.76.

However,

(let ((choices))
  (dotimes (i 10321)
    (push (make-symbol (format "s%d" i)) choices))
  (benchmark-run 10 (delete-dups choices)))

takes 6.26 seconds which is quite faster than the 19.9 seconds reported
by Leo. Maybe a L2 cache effect (2.4GHz Intel Q6600 with 4 MB L2 cache
for each pair of cores.)

> Comparing symbols for equality is a pointer comparison.  Comparing
> strings for equality is a pointer comparison, followed by more work
> (some variation on a memcmp) in case of failure.

Yep. A similar benchmark with strings instead of symbols:

(let ((choices))
  (dotimes (i 10321)
    (push (format "%d" i) choices))
  (benchmark-run 10 (delete-dups choices)))

takes 15.2 seconds, 1.5 per iteration.

Now, why delete-dups takes just 0.7 seconds for a list of strings a bit
*larger* than the one used above? The only difference is that those
strings follow the pattern directory/filename (it's the output of `git
ls-files')

However, the real issue being discussed here is if avoiding the overhead
of delete-dups on ido-completing-read warrants breaking some extensions
on a catastrophic way.




  reply	other threads:[~2013-05-05 15:26 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
2013-05-05 14:31                       ` Stephen J. Turnbull
2013-05-05 15:26                         ` Óscar Fuentes [this message]
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

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

  git send-email \
    --in-reply-to=87ip2xsb1r.fsf@wanadoo.es \
    --to=ofv@wanadoo.es \
    --cc=emacs-devel@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.