Edward A. Romana wrote:
> ~~~
>
> Ok, flowing your advice, I compared the execution time of 2 Maxima and Fortran nested
> do-nothing loops compiled with mode_declare([j,k], fixnum) and implicit none respectively.
> Also I increased the number of loops to overcome process startup time overheads.
> And in the Fortran pgm I added a simple integer counter m=m+1 instruction to to overcome
> the Fortran compiler optimization of the do-nothing loops to zero executed instructions.
>
> The result is that Maxima do-nothing loops compiled using mode_declare are 20 times
> faster than Maxima compilation without it. However Fortran is still 196 times faster
> than Maxima compiled with mode_declare([j,k], fixnum) indexes .
>
> If I understand your explanation, in Maxima even with the loop index declared fixnum,
> the Maxima index variable remains symbolic that is a symbolic integer expression in the
> body of the for-loop can redefine the index. This does not seem too useful me,
> but I am willing to be convinced otherwise, namely are there algorithm examples
> where the expensive symbolic for-loop index is necessary or useful?
If your goal is to crunch numbers and only numbers, then you should
probably stick with Fortran. I doubt maxima will come close Fortran's
speed. Maxima is primarily for symbolic work, but can do numeric work
as well. However, that is not Maxima's focus.
Ray