Re: Numerical code efficiency
"JP Massar" <[email protected]> Mon, 13 Oct 2003 10:59:19 +1300
| Newsgroups | gmane.lisp.corman |
|---|---|
| Message-ID | <[email protected]> |
As far as I know Corman Lisp has not invested any significant effort in optimizing floating point computations. The person writing the original note is making a mistake, IMHO, in using Corman Lisp to test the performance of 'Lisp' wrt floating point. If you want to see what an optimizing Lisp compiler can do with floating point then you should download the free version of Allegro 6.2 Franz Common Lisp and try your various optimizations and timing tests. On Windows, at least, if you disassemble optimized code, you will see native floating point instructions for floating point ops that, I would guess, compare reasonably with that generated for equivalent C code. (This is not meant to be a commerical plug for Franz or anything like that. Just the facts, maam. I have examined the disassembled output of floating point code I have tried to optimize using various Lisp compilers, including Franz, Corman and Lispworks. Franz is the only output that looks to my eye (unlearned as it is in Intel assembler) to generate efficient native instructions). >>> [email protected] 10/13/03 08:22AM >>> On Sun, 12 Oct 2003 11:17:21 -0400, "Dan Muller" <[email protected]> said: > 2. Looking at the disassembled functions, i noticed that svref results > in an actual function call, as does the call to #'+. Is there any > way around this? Declaiming these inline doesn't work; I get a > warning that the source isn't accessible. It looks like there is no inlining of #'+ for floats. The following inlines correctly for fixnums for example: (defun test (a b) (declare (optimize (speed 3) (safety 0)) (type fixnum a) (type fixnum b)) (the fixnum (+ a b))) But the following doesn't for floats: (defun test (a b) (declare (optimize (speed 3) (safety 0)) (type double-float a) (type double-float b)) (the double-float (+ a b))) As for whether it's typical for Lisp compilers, I don't know. CMUCL (which is well known for its optmisation abilities) will inline the second example. Chris. -- Chris Double [email protected] ------------------------ Yahoo! Groups Sponsor To unsubscribe from this group, send an email to: [email protected] Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ ------------------------ Yahoo! Groups Sponsor ---------------------~--> Rent DVDs from home. Over 14,500 titles. Free Shipping & No Late Fees. Try Netflix for FREE! http://us.click.yahoo.com/ArdFIC/hP.FAA/ySSFAA/SyjtlB/TM ---------------------------------------------------------------------~-> To unsubscribe from this group, send an email to: [email protected] Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/