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: [patch] multi-cells (was: Re: Proposal for a Guile binary file format)


Michael Livshin <mlivshin@bigfoot.com> writes:

> Mikael Djurfeldt <mdj@mdj.nada.kth.se> writes:
> 
> > Besides, I think 4-word cells have been implemented already, both by
> > Michael Livshin and Greg Harvey.
> 
> here you go.  now that I look at it, I probably went slightly
> overboard with converting various malloced smobs to multi-cells...
> 
> the summary is thus: with this patch, we have double- and triple-
> cells.  real (double) and complex numbers are now double-cells and
> triple-cells, respectively.  that should hopefully speed up non-integer
> arithmetic (not that I ever measured this, but it should be true ;).

I think three cells might be going a little far... maybe it should be
a configuration option; if not, you end up wasting a pile of heap
space for objects that aren't going to be very common (like, if you
have one guardian, 256k is way too much memory to be using for it,
regardless of how cool guardians are ;). For complex numbers, I don't
know that you'd see much of a performance benefit, simply because the
overhead of following an extra pointer is almost totally overshadowed
by the complexity (heh) of most complex operations; the cost of
collecting another full sized heap should be much larger than doing a
small malloc when a complex number is needed (though it probably
wouldn't be a bad idea to use the list of small chunks idea for
objects that would want to create a 3 cell object).

-- 
Greg, now I have to see if the two cell objects break my gc changes ;)

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