emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] master b0e318d 2/2: Score flex-style completions accor


From: João Távora
Subject: Re: [Emacs-diffs] master b0e318d 2/2: Score flex-style completions according to match tightness
Date: Mon, 18 Mar 2019 14:51:50 +0000

On Mon, Mar 18, 2019 at 2:27 PM Dmitry Gutov <address@hidden> wrote:

> On 17.03.2019 23:46, João Távora wrote:
>
> >> Another thing I'd like to note: with flex completion, RET doesn't select
> >> the current candidate anymore (working as intended, of course). But it's
> >> a bit disorienting.
> >
> > In what situation exactly? Emacs -Q + (setq completion-styles '(flex)) + 
> > what?
>
> + input is not a prefix match. E.g. M-x describe-variable, then input
> 'compst'. RET won't select the completion.

I must be missing something, because that doesn' work in vanilla
Emacs -Q, either, i.e. M-x describe-variable + something + RET will only
select "something" if it is completable to a sole candidate.  Flex works the
same way, though 'compst' will probably match more symbols than
with basic completion (where it matches none).

You might want to bind RET to "minibuffer-force-complete" or
"minibuffer-force-complete-and-exit", but that's orthogonal I think.

Or am I missing something?

> Try a smaller input, like just 'k'. The difference is more stark in that
> case, and the lists of completions are longer.
>
> For the same reason (lots of matches), I'm afraid simply moving matching
> to C won't bring a noticeable improvement.

You're partly right. With shorter input, the burden shifts considerably
from completion-pcm--all-completions (the matching) to
completion-pcm--hilit-commonality (the hilighting and scoring), but
according to the CPU profiler, the former is still dominant, so even a
modest improvement there could still have a large impact.

Capping max matches (after sorting) might bring more improvements
to parts of the code that I'm not profiling (like stuff that iterates all
matches, though I'm not sure what), or by releasing large parts of the
list early for the GC to reap.

As can other techniques like deferring the completion with an idle
timer which is reset on every keystroke.  I'm reasonably confortable
with this last technique and it is usually desirable regardless of other
speed improvements, so I might have a look at that first.

-- 
João Távora



reply via email to

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