Fateman asks:
GCL looks to be pretty fast there!
Is there any c-code for the polynomial/rational function
stuff in Maxima? (In the original code I think
There is c code for ctimes, cplus, and cmod (the integer parts of
polynomial times), which is put on as an optimizer. I just tried an
experiment of removing that code and just putting in the standard
common lisp function proclamations as in sys-proclaim.lisp.
The time went from 2.81 seconds to 2.94 seconds (both were elapsed
time = run time since machine was unloaded), so I guess the
optimizations help a little bit (4.4%). When I originally wrote the C
versions [many years ago!], I had not yet implemented the very fast
function calling of functions with a fixed number of arguments in GCL,
which required my garbage collection of the C stack in GCL etc: Such
functions now compile to c functions of the same number of arguments
and the calls are made via the c stack or via registers depending on
the compiler, and so they are fast, with the only overhead over
regular C being one memory look up since the function call is of the
form (*faddr)(a,b,c) instead of f(a,b,c). Basically there is not much
you can do in C that you can't do in lisp if you understand the
compiler.. Of course since I was the one who did the original version
of gcc for the x86, I do understand both the lisp and c compilers
which of course is one reason I personally like the
maxima->gcl->gcc->assembler chain! Of course our bignum code
is still not so optimal, when I was redoing the bignum code of GCL
last time the good GNU mp bignum code did not exist. Also the
ability of gcc to handle long long 's did not exist. So there is
definitely room for improvement.
Bill