Initial- and boundary-value problems in Maxima.



On Sat, Sep 10, 2011 at 1:39 AM, <talon at lpthe.jussieu.fr> wrote:

>
> Performancewise, unfortunately, maxima colnew is *much* slower than fortran
> colnew. One can expect a factor of 100 slower. Raymond and i have measured
> the time spent in various parts of the program. The principal part is spent
> in the evaluation of the differential equation at the mesh points. Since it
> is given in maxima this requires an excursion in maxima land thus is slow.
>

Perhaps compiling the maxima code will help somewhat.  Unfortunately, the
maxima compiler is a bit buggy.


> One cannot do anything about that. The same occurs for similar problems in
> maple or mathematica. More worrisome, a non negligible part of the time is
> spent in linear algebra computations which should be as fast as in fortran
> if lisp was similarly fast as fortran, as some people claim. But in fact
> these computations are also 100 times slower than in fortran, while being
> pure lisp stuff. Of course this was a major disappointment for me.
>

Yes, this is a disappointment to me as well.  I think part of the problem is
that the Fortran code depends on being able to pass in parts of arrays other
functions.  In Fortran, there is virtually no cost to this; you just pass in
the address of the part you want.  In lisp, you can't do this.  F2cl creates
a displaced array for this (fast), but access to displaced arrays is slow.
F2cl tries to reduce this cost by figuring out the parent array with the
corresponding offset.  The parent array should be a specialized array, so
access is fast.  Except that indexing of the array has an additional cost
because we need the desired index to be added to the offset.  This will slow
down access by at least a factor of 2 or 3.

I don't know why it's 100 times slower, though.  Perhaps some additional
optimizations by f2cl will reduce the cost.

The nice thing about the conversion is that with a little bit of work, we
can actually have a bigfloat version (that will run even slower!).

Ray