emacs-devel
[Top][All Lists]
Advanced

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

Re: Add user customization fido-completion-styles


From: João Távora
Subject: Re: Add user customization fido-completion-styles
Date: Tue, 02 Jun 2020 18:51:31 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.91 (gnu/linux)

Drew Adams <drew.adams@oracle.com> writes:

> As for performance, for `M-x' there certainly is
> no problem.  `M-x' with no input pattern to match
> shows the 6000-some candidates immediately.

Certainly it doesn't _show_ 6000 candidates, right? You must mean it
calculates them quickly and shows the top-sorting set quickly.  That's
great, I guess, and I join in asking if Emacs shouldn't do that.

I didnt' dig down very intensively, but my naive profiling shows the
bulk of the work to be in `all-completions' or thereabouts to be the
main sink of cpu time:

       - icomplete-post-command-hook                             2032  86%
        - icomplete-exhibit                                      2032  86%
         - icomplete-completions                                 2009  85%
          - icomplete--sorted-completions                        1986  84%
           - completion-all-sorted-completions                   1986  84%
            - completion-all-completions                         1982  84%
             - completion--nth-completion                        1982  84%
              - completion--some                                 1982  84%
               - #<compiled 0x15809f8924ad>                      1982  84%
                - completion-flex-all-completions                1965  84%
                 - completion-substring--all-completions         1935  82%
                  - completion-pcm--all-completions              1932  82%
                   - all-completions                             1929  82%
                    - #<compiled 0x1fe57a0ac19d>                 1929  82%
                     - complete-with-action                      1929  82%
                      - all-completions                            37   1%

As you know, all-completions is a C function.  The 1% is suspicious, I
don't know if I should trust it.

Anyway, I'm curious how Icycles evades this.

Anyway2, I wasn't trying this in an Emacs -Q.  When I do, and I set
icomplete-compute-delay to 0, then M-x is practically instantaneous.

Maybe the default 0.3 value of that variable is excessively
conservative.

So, to summarize: I do believe could be some shortcuts for the notable
case of no input pattern to give a speed boost, maybe showing them them
their relevant minibuffer history.  I don't believe there's some kind of
magical speed pickup to be had.

Even the C rewrite of parts of completion-pcm--all-completions
now seems dubious.

> This way of combining yes-no-maybe predicates is
> described here:
>
> https://www.emacswiki.org/emacs/ApplesAndOranges

Have you tried `fido-mode` and/or flex?  Can you think of specific ways
to improve it?  If so, patches are very welcome.

It's a bit harder, I admit, to try to learn Icicles and decide which
features to migrate.  But if you can point some laser-targeted
improvement to the flex algorithm (in efficiency of functionality) are
very welcome.

João



reply via email to

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