Log in

lisp hardware optimization

Joel Reymont* recently joined lisp-hug and initiated a discussion about compiler performance and optimization. It's been interesting; I particularly liked Marc Battyani's followup.


I'm pitting LW 5.0 on Mac Intel against ACL 8.0 in a final round of pre-purchase checks.

I have some heavy-duty floating-point computations. The C function looks like this:

double digamma(double x)
     double p;
     return p;

GCC generates about 200 assembler instructions for the code above.



Disclaimer: It's probably cheating (but after all the target computer is not specified) and the compiler in written in LW so let's say it's relevant here. ;-)

I'm currently working on a the design of a VHPC system and I've written a C to VHDL compiler to transfor this kind of stuff in hardware to put in FPGAs. So I fed this function into this compiler and you can see the result here: www.fractalconcept.com/digamma.pdf
(BTW ouput is easily recognizable as cl-typesetting+cl-pdf ;-)

With this I get a fully pipelined design running at 300MHz so it will take 3.3ms for the computation.
Assuming I can fit 6 of these into my system and split the data, I can compute this in 550µs.

Who said Lisp is slow? :)

edit Marc sent me a note of clarification: "BTW you should put somewhere that 550µs is the time required for 1000000 computations so it's 550ps for one! ;-)"

* See also the last entries on this page.





FYI, Zach, I did end up purchasing LW the same day I started the thread. -joel