emacs-devel
[Top][All Lists]
Advanced

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

Re: funcall consing


From: LdBeth
Subject: Re: funcall consing
Date: Sat, 01 Jan 2022 12:51:53 +0800
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (Gojō) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.2 (x86_64-apple-darwin18.7.0) MULE/6.0 (HANACHIRUSATO)

>>>>> In <8335m8hazn.fsf@gnu.org> 
>>>>>   Eli Zaretskii <eliz@gnu.org> wrote:

ldb> The `80' indicats the GC has been invoked 80 times. That is the direct
ldb> indication of "consing".

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.

```
(progn
  (print gcs-done)
  (eval '(cons 1 2))
  (print gcs-done))
```

-- 
LDB



reply via email to

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