emacs-devel
[Top][All Lists]
Advanced

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

Re: scratch/backend-completion aaaa016056 2/2: Speed it up


From: Stefan Monnier
Subject: Re: scratch/backend-completion aaaa016056 2/2: Speed it up
Date: Sat, 03 Dec 2022 09:10:41 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

> diff --git a/lisp/external-completion.el b/lisp/external-completion.el
> index da3a986b8c..25e94e540b 100644
> --- a/lisp/external-completion.el
> +++ b/lisp/external-completion.el
> @@ -104,8 +104,10 @@ taking a (STRING POINT) as arguments.  The default is to 
> set to
>           `(external-completion-allc . ,(if pred (seq-filter pred all) all))))
>        (`(boundaries . ,_) nil)
>        (_
> -       (let ((all (funcall lookup string (length string))))
> -         (complete-with-action action all string pred))))))
> +       ;; FIXME: Stefan had a call to `lookup' and
> +       ;; `complete-with-action' again here, but that just seems to
> +       ;; slow down things for no good reason, so I took it out.
> +       ))))

The code was definitely needed for some cases like `try-completion`
and `all-completions` (e.g. to make sure we only return completion
of the `string` *prefix* as callers of those functions expect and to
make sure we obey `pred`).

But I'm surprised it made things slow: this code should only be involved
when the user choose some *other* completion style, so could you check
which method of the completion table was invoked?

Maybe we should only use that code when `action` is one of `t` or `nil`?


        Stefan




reply via email to

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