Subject: bug#74561: [PATCH] Allow limiting the size of *Completions*

From: Stefan Monnier <[email-masked]>
Date: Thu, 28 Nov 2024 23:12:59 -0500

> From profiling, the main bottleneck in completion over large
> completion sets is display-completion-list, when there are many
> available candidates.

Hmm... interesting.  I expected it would be the computation of faces
from things like `completion-pcm--hilit-commonality`.

Do you happen to know which part of `display-completion-list` is the
most costly?  is it the actual insertion into the buffer?

I think we should try and fill the buffer lazily.  We don't have much
experience with "jit" populating a buffer (the closest I can think of is
the `vlf` package, which doesn't do "jit", IIRC), so it may take some
trial-and-error until we have something that works, but it
seems worthwhile.

        Stefan