Subject: Re: bug#79074: 31.0.50; Increase gc-cons-percentage in Makefiles

From: Stefan Monnier <[email-masked]>
Date: Sat, 26 Jul 2025 11:18:13 -0400

>> It is definitely very conservative.  But it's used only in
>> interactive mode, not in batch mode:
>> 
>>     % src/emacs -Q --batch --eval '(message "%S" gc-cons-percentage)'
>>     1.0
>>     %
>
> So you are saying that perhaps we should simply increase the current
> value of 1.0 to 1.2, for all non-interactive sessions?

No, just that 0.1 is not the baseline.

But yes, I think I'm also saying that rather than change it just for
compilation, if we want to change it, we should change it in src/emacs.c
for all batch uses.

FWIW, the 1.0 value used nowadays was not carefully chosen.  It was
based on a kind of rule of thumb that mark&sweep GCs generally require
about double the memory in order to work efficiently.
It's a *very* rough rule.  I don't have a strong opinion on whether 1.0
or 1.2  is best, or even whether it's worth trying to find the
"optimal" choice.

But if we do want to fine tune it, maybe it'd be worth re-running
Helmut's measurements for more values, like 0.8, 1, 1.25, 1.6, 2.0, 4.0
to have a more complete picture (I skipped the 2.5 and 3.2 steps because
I expect the difference between 2.0 and 4.0 will already show that this
is beyond the point of diminishing returns).

        Stefan