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: Stefan Monnier
Subject: Re: [Emacs-diffs] master b0e318d 2/2: Score flex-style completions according to match tightness
Date: Wed, 20 Mar 2019 08:09:51 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>>> 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.
>> I was actually comparing flex vs basic in this scenario, and the
>> former was 2x slower. Which is, IDK, could be noticeable.
> I understood that.  I was just saying that in the "2x slower" case, well
> more than half of the time is still spent in
> completion-pcm--all-completions.

FWIW, I think if basic is fast enough and flex is 2x slower, then flex
is likely fast enough as well (or the contrapositive: if flex is too
slow and basic is only 2x faster, then basic is also too slow).

>> It's worth a try. But if filtering will happen right away after the
>> user has stopped typing, that might mean higher CPU usage and lower
>> battery life on a laptop. Just something to be on a lookout for.
> You're absolutely right.  And anyway I noticed icomplete _already_ has a
> while-no-input there, so that technique has already been tried.

Not really: the while-no-input was added long after the rest of the code
was written and was mostly designed for the case where the completion
data takes a *very* long time to get, the main purpose being to be able
to enable icomplete for *all* completion tables rather than only for
those we know to be fast enough.


        Stefan



reply via email to

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