GNU bug report logs - #79021
31.0.50; Unnecessary GC in after-load-functions

Previous Next

Package: emacs;

Reported by: Helmut Eller <eller.helmut <at> gmail.com>

Date: Mon, 14 Jul 2025 20:05:02 UTC

Severity: normal

Found in version 31.0.50

Full log


Message #26 received at 79021 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Colascione <dancol <at> dancol.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 79021 <at> debbugs.gnu.org, eller.helmut <at> gmail.com, monnier <at> iro.umontreal.ca
Subject: Re: bug#79021: 31.0.50; Unnecessary GC in after-load-functions
Date: Fri, 12 Sep 2025 04:00:35 -0700
On September 12, 2025 3:39:39 AM PDT, Eli Zaretskii <eliz <at> gnu.org> wrote:
>> Date: Fri, 12 Sep 2025 01:01:52 -0700
>> From: Daniel Colascione <dancol <at> dancol.org>
>> CC: monnier <at> iro.umontreal.ca, 79021 <at> debbugs.gnu.org
>> 
>> >> -(add-hook 'after-load-functions (lambda (_) (garbage-collect)))
>> >> +;;
>> >> +;; This was probably done to reduce fragmentation with unexec.  With the
>> >> +;; pdumper it makes little sense.  See bug#79021.
>> >> +(if (not (fboundp 'dump-emacs-portable))
>> >> +    (add-hook 'after-load-functions (lambda (_) (garbage-collect))))
>> >
>> >Are we sure the problem no longer happens with pdumper?  Daniel, WDYT?
>> >
>> 
>> It's unnecessary with pdumper, which compacts automatically.
>
>Thanks.
>
>> >In any case, the fboundp test is not enough, we should test the value
>> >of dump-mode instead, I think.  Because Emacs might be built with
>> >pdumper support, but this session is not going to call
>> >dump-emacs-portable, due to command-line options or some other trick.
>> 
>> Just delete it.
>
>It's still useful if starting undumped Emacs, no?

I don't think so. It wouldn't be any more useful than it would be in regular Emacs: GC doesn't differ between a dumped and an undumped Emacs, meaning the code above would be good in both or neither. Since we don't have a theory of why it would be useful in any circumstance post-unexec and have data showing it's a pessimization, let's just delete it and take the complexity reduction win.




This bug report was last modified 7 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.