GNU bug report logs -
#79074
31.0.50; Increase gc-cons-percentage in Makefiles
Previous Next
Reported by: Helmut Eller <eller.helmut <at> gmail.com>
Date: Tue, 22 Jul 2025 15:28:02 UTC
Severity: normal
Found in version 31.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
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 79074 <at> debbugs.gnu.org.
--
79074: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=79074
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
> Cc: 79074 <at> debbugs.gnu.org
> From: Helmut Eller <eller.helmut <at> gmail.com>
> 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.
[Message part 3 (message/rfc822, inline)]
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.
This bug report was last modified 19 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.