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

To reply to this bug, email your comments to 79021 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#79021; Package emacs. (Mon, 14 Jul 2025 20:05:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Helmut Eller <eller.helmut <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 14 Jul 2025 20:05:02 GMT) Full text and rfc822 format available.

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

From: Helmut Eller <eller.helmut <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; Unnecessary GC in after-load-functions
Date: Mon, 14 Jul 2025 22:04:18 +0200
In loadup.el there is this:

  (add-hook 'after-load-functions (lambda (_) (garbage-collect)))

What's this for?  It seems unnecessary.

It would be nice to remove this, because without it the time to execute
loadup.el goes down from 13 seconds to 6.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79021; Package emacs. (Tue, 15 Jul 2025 02:31:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Helmut Eller <eller.helmut <at> gmail.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 79021 <at> debbugs.gnu.org
Subject: Re: bug#79021: 31.0.50; Unnecessary GC in after-load-functions
Date: Tue, 15 Jul 2025 05:30:40 +0300
> From: Helmut Eller <eller.helmut <at> gmail.com>
> Date: Mon, 14 Jul 2025 22:04:18 +0200
> 
> In loadup.el there is this:
> 
>   (add-hook 'after-load-functions (lambda (_) (garbage-collect)))
> 
> What's this for?  It seems unnecessary.
> 
> It would be nice to remove this, because without it the time to execute
> loadup.el goes down from 13 seconds to 6.

I presume this is because we don't want to dump any garbage.

Stefan?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79021; Package emacs. (Tue, 15 Jul 2025 14:00:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 79021 <at> debbugs.gnu.org, Helmut Eller <eller.helmut <at> gmail.com>
Subject: Re: bug#79021: 31.0.50; Unnecessary GC in after-load-functions
Date: Tue, 15 Jul 2025 09:59:38 -0400
>> In loadup.el there is this:
>> 
>>   (add-hook 'after-load-functions (lambda (_) (garbage-collect)))
>> 
>> What's this for?  It seems unnecessary.
>> 
>> It would be nice to remove this, because without it the time to execute
>> loadup.el goes down from 13 seconds to 6.
>
> I presume this is because we don't want to dump any garbage.
> Stefan?

AFAIK it was added to keep the dumped Emacs' heap "dense": if we run the
GC only "in the normal way", the heap objects created during `loadup.el`
end up interspersed with more free spaces.

It's possible/likely that the portable dumper has made that unnecessary.


        Stefan





This bug report was last modified 1 day ago.

Previous Next


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