On 3/19/12 5:39 AM, Michel Talon wrote:
>
> Yes, half of the running time comes from callbacks to maxima, which one cannot
> speed up (maybe one can compile the maxima formulae, but when i tried it was
> buggy). Half of the running time comes from lapack and colnew routines
> (translated from fortran to lisp). These are literally 100 times slower than
> the Fortran versions, and this is terrible. One may hope to cut this to
> 10 times slower, this would be very nice, but at the end of the day would only
> cut total execution time by 2, unfortunately.
Just wanted to mention that in the latest development version of
matlisp, Akshay Srinivasan has added CFFI support and support for
callbacks. It's still in the development stage, but it seems to work
quite nicely.
Therefore, I took the opportunity to compile up the Fortran version of
colnew and run this in matlisp with the callbacks written in lisp. Demo
2, in maxima, takes about 3 sec to load(prob2), which includes all of
the stuff to set up the problem. If I time just the call to colnew, it
takes about 2.5 sec. And I turned off all of the diagnostic prints.
F2cl is pretty bad with Fortran prints. (Actually cmucl's format is
somewhat slow too because it works very hard to get a correctly printed
floating-point result.)
When run in matlisp, the equivalent takes about 0.13 sec on the same
machine, including all of the diagnostic prints.
A better benchmark might be to use Michel's prob4 demo. Haven't gotten
around to functions to Lisp.
Ray