[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Tue, 30 Oct 2001 05:58:40 +0100
I have recently noticed that the garbage collector keeps waking up
even while executing something as simple as:
guile> (let loop () (loop))
IMHO the interpreter should minimize such consing in order to reduce
the garbage collector's activity (eventually to disable it in some
applications like batch processing), since waking up the garbage
collector frequently, expecially when the heap grows large, kills the
responsiveness of interactive applications and the raw performance in
non interactive programs (e.g, a ray tracer), that are not given a
chance to garbage collect while waiting for input.
Also, there seem to be no way even for C code to free a cons cell
explicitly, when you are sure that it will no longer be referenced.
(except maybe by playing around with the freelist, something still
beyond my understanding).
Implementation-wise, some changes i'd propose are:
* to specialize the scm_call_* and scm_apply_* functions, which
currently just build lists for the arguments and pass them to
* create C functions to free pairs and other boxed data explicitly,
and eventually even create a scheme callable interface for them (this
could be beneficial to number processing applications, when dealing
with fixed matrices, complex or floating point numbers.
* reimplement some function that apply a variable number of arguments
to other functions, (like call-with-values, map, for-each), and
specialize the case in which the closure to be called takes a fixed
number of arguments.
I'd like to hear your opinion... is this issue marginal? would the
complexity introduced by the fix not worth the performance gain?
Thank you for your patience. Michele
Michele Bini <=