Maxima/Ecl on 32-bit machine cannot evaluate "apply(union, listify({{..}}))"



On Sat, Sep 6, 2008 at 2:58 PM, Oliver Kullmann <O.Kullmann at swansea.ac.uk>wrote:

> Regarding union and intersection.
> The really big speed-up seems to take place when replacing "apply" by
> "tree_reduce". But this already with 5.15.0 (and with clisp and ecl).
>
> Now I downloaded the new nset (CVS), and this speeds up tree_reduce a tiny
> bit for ecl, and more noticeable for clisp; while for apply nothing happens.
>
> Is this as expected?
>

Yes, apply has not been changed at all.  The bug that was patched should
give a large performance increase for x/l/r/tree reduce when the
intermediate results are large sets.  When that happens depends on exactly
what arguments you are supplying, and their order, but in many common cases,
tree_reduce has smaller intermediate results.

I do not understand why r/l reduce are so much slower than tree_reduce in
other cases; on my install (Maxima 5.15/GCL 2.6.8) this may be a GCL
problem, but I haven't looked at it in detail.


> So it seems that for union etc. tree_reduce should from now on be used,
> while for big concatenations of lists "append" is still fasted (chopping up
> very big argument lists in pieces).
>

In some simple tests of l/r/tree reduce of append, rreduce is the fastest on
my machine (as expected) and is the same speed as apply; it has the
advantage of not being limited to 63 arguments on any of our platforms
(including GCL).

Keep in mind that *any* n-argument reduction (including the implicit ones in
multi-argument append, union etc.) chooses some way to associate the
arguments.  If you know something about the pattern of arguments you are
giving the reduction, you can often choose a more appropriate one.

On a different topic, the current union/intersect/etc. functions are pretty
fast, but could be made faster in many important special cases.  I had not
done that up to now because I wasn't aware that anyone was using them for
large arguments.  Now that I know, I'll improve them.

             -s