emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] (icomplete-vertical-mode): Add support for affixations and,


From: Daniel Mendler
Subject: Re: [PATCH] (icomplete-vertical-mode): Add support for affixations and, annotations
Date: Tue, 1 Jun 2021 16:40:17 +0200

On 6/1/21 4:30 PM, João Távora wrote:
>> The design of the `group-function` has been extensively discussed. The
>> flag is used instead of a tuple for performance reasons. The computation
>> of the transformed candidate string may require string allocations,
>> which are expensive if performed for every candidate.
> 
> That's right, I see your point.
> 
> They could return a lambda, which is cheap to allocate, to defer the
> calculation.  Or just nil or #'identity if it's supposed to stay
> unchanged.
> ...
> The protocol is slightly simpler since it returns the same type every
> time.  More importantly, this avoids threading group-fn down a bunch of
> functions in minibuffer.el, where it seems to be adding an awful lot of
> complexity.

No, I am against changing the group function. I am using this efficient
definition in my packages and I rely on the performance characteristics.

The current implementation is simple enough and also avoids allocation
of the cons pair and the allocation of the lambda as in your proposal.
The efficiency is crucial here. Furthermore I argue that the current
implementation is simpler to understand for the completion table authors
than your counter proposal, which introduces a deferred computation with
the lambda.

There was a long discussion with Stefan, Dmitry,  Juri and Eli where
multiple different designs for the `group-function` have been considered
and we settled on the current design.

Daniel



reply via email to

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