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

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 02 Aug 2025 14:23:02 +0000

Your bug report

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

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
79074: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=79074
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#79074: 31.0.50; Increase gc-cons-percentage in Makefiles
From: Eli Zaretskii <[email-masked]>
To: Helmut Eller <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Sat, 02 Aug 2025 17:22:18 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> Cc: [email-masked]
> From: Helmut Eller <[email-masked]>
> Date: Mon, 28 Jul 2025 13:19:12 +0200
> 
> On Sat, Jul 26 2025, Stefan Monnier wrote:
> 
> >> It seems that the default value for gc-cons-percentage (10%) is very
> >> conservative and hurts performance.
> >
> > 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
> >     %
> 
> Ah, I didn't know that; but it makes sense.  Which means that the bug
> can be closed.

Thanks, closing.

Subject: 31.0.50; Increase gc-cons-percentage in Makefiles
From: Helmut Eller <[email-masked]>
To: [email-masked]
Date: Tue, 22 Jul 2025 17:27:11 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

It seems that the default value for gc-cons-percentage (10%) is very
conservative and hurts performance.

I did the following experiment: first, I built the master branch (with
-O2 and without checking); second, I executed this script:

for percentage in 0.1 0.75 1.5 ; do
    find lisp/ -name '*.elc' -exec rm -v {} +
    /usr/bin/time -o make-$percentage.time make -l3.2 -j4 \
BYTE_COMPILE_EXTRA_FLAGS="--eval '(setq gc-cons-percentage $percentage)'"\
lisp
done

The intention is to measure the time it takes to compile all the .el
files in the lisp directory for different values of gc-cons-percentage.
I get these results:

* for gc-cons-percentage = 0.1:
1697.81user 57.67system 12:08.57elapsed 240%CPU (0avgtext+0avgdata 202268maxresident)k
12424inputs+173840outputs (29major+9304710minor)pagefaults 0swaps

* for gc-cons-percentage = 0.75
1034.16user 61.77system 7:55.26elapsed 230%CPU (0avgtext+0avgdata 216888maxresident)k
42864inputs+172280outputs (157major+10152739minor)pagefaults 0swaps

* for gc-cons-percentage = 1.5
823.91user 65.62system 6:27.09elapsed 229%CPU (0avgtext+0avgdata 246948maxresident)k
118640inputs+171184outputs (106major+12651774minor)pagefaults 0swaps

We see that increasing gc-cons-percentage to 0.75 reduces the elapsed
real time considerably (from ~12 minutes to ~8); it increases maxrss from
203MB to 216MB, which seems quite modest.

So I think we should add something to BYTE_COMPILE_FLAGS to increase
gc-cons-percentage; or perhaps increase it in batch-byte-compile.