From: Daniel Mendler via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 68214@debbugs.gnu.org, Juri Linkov <juri@linkov.net>
Subject: bug#68214: Completion sorting customization by category
Date: Thu, 02 Jan 2025 18:29:15 +0100 [thread overview]
Message-ID: <87ikqxcefo.fsf@daniel-mendler.de> (raw)
In-Reply-To: <jwvseq12llu.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Thu, 02 Jan 2025 12:09:01 -0500")
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>> Why do we need this memoization? If it's performance sensitive wouldn't
>>> it more effective to cache at a higher level (e.g. to memoize
>>> `completion-metadata-get`)?
>>
>> The memoization ensures that `completion-metadata-get' doesn't allocate
>> and performs a symbol lookup only, as has been the case before the
>> addition. The function is called often from completion UIs which
>> auto-update on every keypress.
>
> I understand there is a benefit. I just wonder how important it is in
> practice (if it's done 2-3 times per keypress it's likely lost in the
> noise) and whether it's the best place to put it.
Well, for comparison, in Corfu people asked me not to repeatedly
recreate timer objects on every key press and instead reuse them, so the
accumulated garbage matters somewhat. I think it is better not to
degrade functions which have been cheap before, such that they become
significantly more costly, even if the function may not matter that much
in the greater scheme. I'd appreciate if we keep the function as is,
unless you are bothered too much by it. I've ported this back to
compat-30 already and it is in the emacs-30 branch. But maybe add
with-memoization for conciseness?
Daniel
next prev parent reply other threads:[~2025-01-02 17:29 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-02 17:07 bug#68214: Completion sorting customization by category Juri Linkov
2024-01-03 7:20 ` Daniel Mendler
2024-01-03 16:07 ` Juri Linkov
2024-01-03 17:12 ` Daniel Mendler
2024-01-04 17:21 ` Juri Linkov
2024-01-05 7:59 ` Juri Linkov
2024-01-05 8:33 ` Daniel Mendler
2024-01-06 17:33 ` Juri Linkov
2024-01-06 17:59 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-07 18:05 ` Juri Linkov
2024-01-07 18:37 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-09 17:59 ` Juri Linkov
2024-01-09 18:14 ` Juri Linkov
2024-01-09 18:31 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-10 7:35 ` Juri Linkov
2024-01-10 8:53 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors
[not found] ` <jwv7c7d5iwi.fsf-monnier+emacs@gnu.org>
[not found] ` <87ldvtci2f.fsf@daniel-mendler.de>
[not found] ` <jwvseq12llu.fsf-monnier+emacs@gnu.org>
2025-01-02 17:29 ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
[not found] ` <jwvcyh55j4y.fsf-monnier+emacs@gnu.org>
2025-01-06 19:40 ` Juri Linkov
2025-01-06 20:22 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2025-01-07 18:22 ` Juri Linkov
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=87ikqxcefo.fsf@daniel-mendler.de \
--to=bug-gnu-emacs@gnu.org \
--cc=68214@debbugs.gnu.org \
--cc=juri@linkov.net \
--cc=mail@daniel-mendler.de \
--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.