[Top][All Lists]

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

Re: t and nil in pure memory?

From: Stefan Monnier
Subject: Re: t and nil in pure memory?
Date: Wed, 11 Nov 2009 17:56:34 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

> The last GC before dumping generates 200K calls to mark_object, of those
> 20K have Qt or Qnil as an argument.

> Would it make sense to put Qt and Qnil in pure memory?

No, because they may contain pointers to objects that aren't in pure
memory (via the plist).

> Moving Qt and Qnil in pure memory would break things like:
> (put t 'foo 'bar)


> but maybe this works by accident rather than design.

No, it's no accident.

> More generally it would be very good to be able to put symbols in pure
> memory, about 1/3 of the mark_object calls are for symbols, and it does
> not seem that it's too useful to GC `car', `cdr', etc.  But it does not
> seem to be too easy to do :-(

Since symbols have mutable fields that can contain pointers, it's
important to let the GC trace through them.

If we want to speed up the GC, then we should look at changing the
algorithm (e.g. make it generational).

Maybe we can also micro-optimize the code to let it run faster: we could
probably make `mark_object' into a macro that first checks the markbit
and only if that fails does it call really_mark_object recursively.
Of course, tests would be needed to try and figure out whether it really
makes things faster.


reply via email to

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