From: mail@daniel-mendler.de
To: jakanakaevangeli <jakanakaevangeli@chiru.no>
Cc: 46326@debbugs.gnu.org
Subject: bug#46326: 27.1.50; Excessive memory allocations with minibuffer-with-setup-hook
Date: Tue, 09 Feb 2021 01:19:05 +0100 [thread overview]
Message-ID: <558af936c04bf691e6eb953e2212bccd@mendler.net> (raw)
In-Reply-To: <87v9b29aia.fsf@miha-pc>
On 2021-02-08 10:25, jakanakaevangeli wrote:
> I seem to have solved the problem by doing the following simple
> substitutions in add-hook and remove-hook:
>
> (alist-get ... #'equal) -> (alist-get ...)
> equal -> eq
> member -> memq
> delete -> delq
>
> This changes the behaviour of add/remove-hook a little, for example
>
> (add-hook (lambda () (test)))
> (remove-hook (lambda () (test)))
>
> will not be reverse operations anymore, since the two lambdas are not
> eq
> as they are created separately. But the performance gain for big
> non-compiled closures might be worth considering.
Thank you, this also seems like a possible solution. However I fear that
it
is way to intrusive and could break a lot of existing code. As I
mentioned
before set-transient-map avoids adding a letrec-lambda via add-hook
because
it would make problems with equal. This means the "broken nature" of
add-hook
is somehow accepted pervasively over the Emacs codebase. My fix is less
intrusive
in the sense that it would just fix `minibuffer-with-setup-hook'.
next prev parent reply other threads:[~2021-02-09 0:19 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-05 12:51 bug#46326: 27.1.50; Excessive memory allocations with minibuffer-with-setup-hook mail
2021-02-05 14:09 ` Eli Zaretskii
2021-02-05 15:20 ` mail
2021-02-05 15:58 ` Eli Zaretskii
2021-02-05 16:10 ` mail
2021-02-08 9:25 ` jakanakaevangeli
2021-02-09 0:19 ` mail [this message]
2021-02-09 22:13 ` jakanakaevangeli
2021-04-23 18:26 ` Stefan Monnier
2021-04-23 19:28 ` Daniel Mendler
2021-04-23 20:34 ` jakanakaevangeli
2021-04-23 20:52 ` Daniel Mendler
2021-04-23 21:27 ` Stefan Monnier
2021-04-24 6:10 ` Eli Zaretskii
2021-04-24 13:06 ` Stefan Monnier
2022-06-16 13:06 ` Lars Ingebrigtsen
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=558af936c04bf691e6eb953e2212bccd@mendler.net \
--to=mail@daniel-mendler.de \
--cc=46326@debbugs.gnu.org \
--cc=jakanakaevangeli@chiru.no \
/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.