emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: funcall consing


From: Eli Zaretskii
Subject: Re: funcall consing
Date: Sat, 01 Jan 2022 09:28:02 +0200

> Date: Sat, 01 Jan 2022 12:51:53 +0800
> From: LdBeth <andpuke@foxmail.com>
> Cc: LdBeth <andpuke@foxmail.com>,
>       tom@logand.com,
>       emacs-devel@gnu.org
> 
> Eli> Why are you saying that the number of times GC has been invoked is the
> Eli> direct indication of consing?  I don't think it is.  Emacs doesn't
> Eli> call GC because it knows how much consing was done, it calls GC in
> Eli> certain strategic points in the interpreter, when the Lisp program
> Eli> happens to hit those points.  And funcall is indeed one of those
> Eli> points.
> 
> The docstring of `gc-cons-threshold' says:
> 
> | Number of bytes of consing between garbage collections.
> | Garbage collection can happen automatically once this many bytes have been
> | allocated since the last garbage collection.  All data types count.
> |
> | Garbage collection happens automatically only when ‘eval’ is called.
> 
> ``GC checkpoints'' are not equivlent to the actually invocation of GC
> that would increase `gcs-done' (that is the variable been used by
> `benchmark-run' to calculate the gc numbers). Otherwise, either this
> docstring is untrue or the snippet below would always print different
> numbers.

See my other message about the details: you are reading too much into
the doc string.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]