Subject: 31.0.50; Increase gc-cons-percentage in Makefiles

From: Helmut Eller <[email-masked]>
Date: Tue, 22 Jul 2025 17:27:11 +0200

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.