[Ecls-list] Consing statistics?

Juan Jose Garcia-Ripoll jjgarcia at users.sourceforge.net
Thu Dec 28 18:20:49 UTC 2006


2006/12/28, Dave Roberts <dave at vyatta.com>:
> > No changes to the Boehm code yet. Before every garbage collection we
> > inspect a variable (GC_words_allocd) that counts the number of words
> > allocated since the last garbage collection. This is added to a lisp
> > integer, which at some point may become a bignum.
>
> Ah, gotcha. That would work. So the bytes allocated is the sum of the
> running bignum plus the current GC_words_allocd ? I guess you're relying
> on the C counter not overflowing between GCs, but if it's a size_t sized
> object, you'd have to allocate all of memory to overflow, which would
> surely trigger a GC. I'd just think through things on a 64-bit machine
> and make sure there isn't any strange overflow that could happen there.

This counter is the one that triggers GCs. It will not overflow, since
it is set to zero _after_ the GC.

> > Since creating bignums itself "conses", the counter is reset when
> > entering a timed piece of code, and deactivated by setting
> > cl_object.bytes_consed = OBJNULL afterwards. This is, in my opinion,
> > better than what SBCL does: updates a bignum on every GC.
>
> It would be nice to leave this around all the time. While getting the
> statistic in TIME is useful, it can be useful at other times, too.

Incidentally, the first patch consed a single bignum on each call, but
somehow this affected the performance a lot. I am not sure whether
this has to do with calling consing the number from within the garbage
collector but the fact is that it did not work well.

The current way it is done, by destructively modifying a bignum, seems
to perform better and I might activate it permanently in the future.
However, since one also plans to include GC time statistics, I am
unsure on whether this information should be collected at all times.

Let's see. Right now I am busy with Brian's patch.

Juanjo

-- 
Dpto. de Fisica Teorica I, Fac. de CC Fisicas, Universidad Complutense,
Ciudad Universitaria s/n Madrid 2804 (Spain)
http://teorica.fis.ucm.es/~jjgarcia/




More information about the ecl-devel mailing list