Re: Numerical code efficiency
"Dan Muller" <[email protected]> Mon, 13 Oct 2003 20:01:30 -0400
| Newsgroups | gmane.lisp.corman |
|---|---|
| Message-ID | <[email protected]> |
Thanks, that's exactly the sort of information that I was looking for. I hadn't gotten around to trying fixnums in Corman Lisp. I'll definitely try out some other implementations. I poked around a bit in the source code but didn't figure out where the compile decides whether or not to inline math operations. I might look at this a bit more at some point. The fact that Corman Lisp comes with all the source code, and the attractive price for a commercial development license, continues to hold my interest in this implementation. At 05:59 PM 10/12/2003, you wrote: >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/ > > > > >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/ Dan Muller [email protected] Some people believe in absolutes. Others aren't so sure. --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 10/13/2003 Tested on: 10/13/2003 8:01:31 PM avast! is copyright (c) 2000-2003 ALWIL Software. http://www.avast.com ------------------------ Yahoo! Groups Sponsor ---------------------~--> Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511 http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/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/