GNU bug report logs - #25995
26.0.50; Mismatch between documented and actual behaviour of icomplete

Previous Next

Package: emacs;

Reported by: Alexis <flexibeast <at> gmail.com>

Date: Mon, 6 Mar 2017 11:13:01 UTC

Severity: minor

Tags: confirmed, fixed

Found in version 26.0.50

Fixed in version 26.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


Message #16 received at 25995 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 25995 <at> debbugs.gnu.org, Alexis <flexibeast <at> gmail.com>
Subject: Re: bug#25995: 26.0.50;
 Mismatch between documented and actual behaviour of icomplete
Date: Sun, 18 Jun 2017 23:28:52 -0400
[Message part 1 (text/plain, inline)]
Dmitry Gutov <dgutov <at> yandex.ru> writes:

> On 3/10/17 1:25 AM, npostavs <at> 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

[bench-filter.el (application/emacs-lisp, attachment)]

This bug report was last modified 8 years and 64 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.