GNU bug report logs -
#79021
31.0.50; Unnecessary GC in after-load-functions
Previous Next
Full log
View this message in rfc822 format
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.