emacs-devel
[Top][All Lists]
Advanced

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

Re: master 695f679: Remove ; ; ; ###tramp-autoload cookie from Tramp def


From: Basil L. Contovounesios
Subject: Re: master 695f679: Remove ; ; ; ###tramp-autoload cookie from Tramp defcustoms (Bug#47063)
Date: Fri, 26 Mar 2021 15:57:01 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>>> What's the performance impact here?  This is going to be called a whole
>>> bunch of times when the user hits TAB...
>>
>> It should be OK to do the condition-case wrapping around the loop rather
>> than within it, so the performance impact should be negligible.
>
> Yup; if it's hoisted out of the loop, there'd be no performance impact,

I see no discernible performance impact even if the
condition-case-unless-debug is added into the completing-read predicate,
to catch errors from user-provided read-extended-command-predicate
values.

Running the new attached benchmark with:

  emacs -Q -batch -f batch-byte-compile bench2.el
  emacs -Q -l bench2.elc

gives the following timing excerpts:

  TAB RET

  read-extended-command
    bench--expensive                     1.801461 36 0.568592
    nil                                  0.985272 35 0.552688
    command-completion-default-include-p 0.837255 29 0.453390
    bench--safe                          0.834056 29 0.452686
  bench-read-extended-command
    bench--expensive                     1.803410 36 0.566920
    nil                                  0.977062 35 0.549054
    command-completion-default-include-p 0.831130 29 0.452036
    bench--safe                          0.831380 29 0.451495

  e w w - TAB C-a C-k RET

  read-extended-command
    bench--expensive                     1.082884 30 0.415545
    nil                                  0.992358 30 0.417027
    command-completion-default-include-p 0.895481 25 0.343474
    bench--safe                          0.886560 25 0.344851
  bench-read-extended-command
    bench--expensive                     1.081067 30 0.414472
    nil                                  0.990662 30 0.415502
    command-completion-default-include-p 0.886688 25 0.343094
    bench--safe                          0.898391 25 0.344109

So back to the original question: do we want this safety net in
command-completion-default-include-p, around
read-extended-command-predicate (which is user-customisable), or not at
all?

And if we do add it, should it include a helpful message as per
Michael's suggestion?

I'm happy either way.

-- 
Basil

Attachment: bench2.el
Description: application/emacs-lisp


reply via email to

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