daly at axiom-developer.org wrote:
>> As for space optimization I'm not sure it matters. I can't think of a
> case where inlining will happen so many times that space is an issue.
> Who writes a function with 50 mapcars? For space optimization it might
> be better to throw away the cached sources.
Here is an example where there is LOTS of inlining. CMUCL supports
double-double floats and has support for unboxed double-double floats.
However, to make things fast, the code that implements the basic
arithmetic operations is inlined. So the routine that calculates log(x)
via rational approximation has inlined lots of routines, perhaps 50 or
more arithmetic operations. A double-double add takes about 200 bytes.
The space used is a lot.
I also have a quad-double implementation. That is even larger because a
quad-double operation is some 1K bytes long. But if you don't inline
the basic arithmetic function and all the internal functions that are
needed to implement it, the consing slows down the operation by a
significant fraction (half or more?). To make these inline, I had to
increase CMUCL's inlining threshold to 1600 (the upper limit on the
number of inline function calls that will be expanded in any given code
object).
Anyway, this is really way off topic for maxima, so I will refrain from
saying more on this list.
Ray