This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: is there a gc hook?


Russell McManus <russell.mcmanus@msdw.com> writes:
>> Is there a way for me to time gc runs and print out the results?
>> I've got some performance issues I've got to track down, and I didn't
>> see anything obvious in the source code.

Roland:
For performance issues it may be useful to check the results from
(gc-stats)

((gc-time-taken . 359) (cells-allocated . 39945)
 (cell-heap-size . 98304) (bytes-malloced . 144116)
 (gc-malloc-threshold . 150000)
 (cell-heap-segments (1076101128 . 1075838984) (1076629512 . 1076105224)))

even though I'm not sure how to interpret the gc-time-taken correctly,
I've only used the memory counts for my performance measurements when
tuning away unnessecary conses and mallocs. For time measurements I've
used the time as returned by the (default) repl loop in ice-9 when setting
the verbose-level (which uses gc-time-taken).

Greg J. Badros <gjb@cs.washington.edu> writes:
> We've talked about adding C-level gc hooks to register a single C
> function to be called at start of GC and another at end of GC.  Those
> functions would have to carefully not allocate a cell or otherwise mess
> with the Scheme heap, or else undefined behaviour.  I'd certainly be
> happy with (the fairly straightforward) patch to support this, and will
> do it if no-one else submits something, and others agree that it'd be a
> useful feature to have.

For the longer term a background gc is on my wishlist. In such a case
that kind of hook function would not be so meaningful even though it
will be "harmless".

	Best regards
	Roland

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]