compilation speeds



Compilation speeds up numerical computation of properly declared expression
evaluation.  If there is no declaration of fixnums, floats, etc. then
nothing much can be done. You can't compile a+b to anything much different
from evaluate(simplify("a+b"))   if you have no information about a and b.

If they are both double-precision floats, then the addition can be done in a
few instructions.

Also, the ability to compile code may vary depending on which implementation
of Maxima you are using. Ultimately this has to go through a lisp compiler,
and some lisp compilers do more work than others.  Going 3X slower seems
unusual, however the translation code was done a long time ago, and probably
not very well.

Maybe you should post what you think of as a particularly time-consuming
part of your computation, and get suggestions.

RJF


> -----Original Message-----
> From: maxima-bounces at math.utexas.edu [mailto:maxima-
> bounces at math.utexas.edu] On Behalf Of sen1 at math.msu.edu
> Sent: Wednesday, November 15, 2006 5:24 AM
> To: maxima at math.utexas.edu
> Subject: compilation speeds
> 
> Hello,
>   I recently tried to increase the speed of some of my maxima programs
>   using the "compile(all)" option.
> 
> The resulting programs took three times as long to execute as the same
> programs which were not compiled.
> 
>    Isn't it to be expected that the compiled code will execute faster?
> 
>    Any ideas or suggestions?
> 
>   -sen
> 
> --
>   ------------------------------------------------------------------------
> ---
>   | Sheldon E. Newhouse            |    e-mail: sen1 at math.msu.edu
> |
>   | Mathematics Department         |       				   |
>   | Michigan State University      | telephone: 517-355-9684
> |
>   | E. Lansing, MI 48824-1027 USA  |       FAX: 517-432-1562
> |
>   ------------------------------------------------------------------------
> ---
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima