all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Jordan Ellis Coppard <jc+o.emacs@wz.ht>
Cc: 73473@debbugs.gnu.org
Subject: bug#73473: 31.0.50; Minibuffer completions include nonsense prefix candidates
Date: Fri, 27 Sep 2024 11:12:01 -0400	[thread overview]
Message-ID: <jwvfrpluouk.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <86r097btqc.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 25 Sep 2024 19:09:31 +0300")

>> I've noticed that my completions have slowed down A LOT on recent Emacs
>> builds, it turns out nonsense completion candidates (which I am calling
>> "prefix candidates") are being included as... completion candidates.
[...]
>> To reproduce, using `emacs -Q` of course:
>>
>> 1. Open Emacs.
>> 2. C-h o foo TAB
[...]
>> If I do the same on the currently released Emacs or another (older)
>> build of Emacs (30.0.50) there are 79 (not 80) completion candidates and
>> `footnote-` is not listed as one.

This was done on-purpose: the `footnote-` prefix is included as a "stand
in" for the not-yet-loaded definitions of `footnote.el`.  The idea is
that if you're looking for, say, `PREFIX-SUFFIX` in package PREFIX you
can get there by doing

    C-h o PREF TAB

which completes to `PREFIX-`, and then

    SUF TAB

(which now works because `PREFIX.el` was loaded under the hood).

AFAICT, there is a performance bug here in that just doing the
`C-h o PREF TAB` which completes to `PREFIX-` already loads `PREFIX.el`
which is a bit over-enthusiatic (I intended it to load `PREFIX.el`
only when you hit TAB while you already have `PREFIX-` in your
minibuffer).

>> This seems to be occurring for almost every unique prefix possible, 
>> compounding as time goes on. So later on `f-` is listed as a completion 
>> candidate, then also `go-` and so on. These are not valid completion 
>> candidates. `footnote-` is not a symbol. Over time the huge increase in 
>> completion candidate volume (and perhaps what is causing this behind the 
>> scenes) results in such a slowdown that I can visibly see Emacs crawl to 
>> 1 FPS when I type in minibuffer completion, when the exact same init.el 
>> on said older 30.0.50 is faster.

It's probably not directly linked to the number of symbols defined, but
rather to side-effects introduced by some of the packages that were
loaded (which I'd argue are probably themselves (performance) bugs in
those packages).


        Stefan






  parent reply	other threads:[~2024-09-27 15:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-25 10:54 bug#73473: 31.0.50; Minibuffer completions include nonsense prefix candidates Jordan Ellis Coppard via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-25 16:09 ` Eli Zaretskii
2024-09-26  6:21   ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-27 15:12   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-09-27 15:35     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvfrpluouk.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=73473@debbugs.gnu.org \
    --cc=jc+o.emacs@wz.ht \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.