From: npostavs@users.sourceforge.net
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 25995@debbugs.gnu.org, Alexis <flexibeast@gmail.com>
Subject: bug#25995: 26.0.50; Mismatch between documented and actual behaviour of icomplete
Date: Sun, 18 Jun 2017 23:28:52 -0400 [thread overview]
Message-ID: <87injsr6yz.fsf@users.sourceforge.net> (raw)
In-Reply-To: <93815f6a-22a9-f8b5-2583-5b8bd9906d48@yandex.ru> (Dmitry Gutov's message of "Mon, 19 Jun 2017 03:19:16 +0300")
[-- Attachment #1: Type: text/plain, Size: 1566 bytes --]
Dmitry Gutov <dgutov@yandex.ru> writes:
> On 3/10/17 1:25 AM, npostavs@users.sourceforge.net wrote:
>
>> --- i/lisp/minibuffer.el
>> +++ w/lisp/minibuffer.el
>> @@ -3257,7 +3257,7 @@ completion-pcm--filename-try-filter
>> "\\)\\'")))
>> (dolist (f all)
>> (unless (string-match-p re f) (push f try)))
>> - (or try all))))
>> + (or (nreverse try) all))))
>
> Looks good to me, thank you.
>
> But what are the chances of this 'nreverse' (or the whole function)
> being performance-significant?
>
> Maybe we could switch this code to `cl-delete-if'. From my testing,
> it's considerably faster than dolist+push (even without nreverse).
I don't have a good sense of how the completion code fits together, so
I'm not sure how significant the performance of this function is, but in
my simplistic benchmark I found the opposite: dolist+push+nreverse is
quite a bit faster (although the difference can be swamped by GC). So
adding `nreverse' won't be a problem.
~/src$ emacs -Q -batch -l emacs/bench-filter.elc
dolist+push 1000
Elapsed time: 0.000335s
dolist+push 10000
Elapsed time: 0.001951s
dolist+push 100000
Elapsed time: 0.056526s (0.035910s in 1 GCs)
dolist+push+nreverse 1000
Elapsed time: 0.000212s
dolist+push+nreverse 10000
Elapsed time: 0.002086s
dolist+push+nreverse 100000
Elapsed time: 0.019966s
cl-delete-if 1000
Elapsed time: 0.002174s
cl-delete-if 10000
Elapsed time: 0.003604s
cl-delete-if 100000
Elapsed time: 0.034759s
[-- Attachment #2: benchmark code --]
[-- Type: application/emacs-lisp, Size: 1948 bytes --]
next prev parent reply other threads:[~2017-06-19 3:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-06 11:12 bug#25995: 26.0.50; Mismatch between documented and actual behaviour of icomplete Alexis
2017-03-09 23:25 ` npostavs
2017-06-19 0:19 ` Dmitry Gutov
2017-06-19 3:28 ` npostavs [this message]
2017-06-21 2:04 ` Dmitry Gutov
2017-06-21 2:50 ` npostavs
2017-06-21 22:17 ` Dmitry Gutov
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=87injsr6yz.fsf@users.sourceforge.net \
--to=npostavs@users.sourceforge.net \
--cc=25995@debbugs.gnu.org \
--cc=dgutov@yandex.ru \
--cc=flexibeast@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).