I am doing some simulation work involving lots of floating point
operations. I am currently working in C, but I would vastly
prefer to work with LISP.
I have heard that there exist implementations of LISP
which are as fast as C. Is this true?
Also, can anybody point me to a source that gives examples of LISP
code that is optimized for speed? Do I have a chance to make a LISP
program run half as fast as the comparable C code?
thanks in advance,
Lael Schooler
In article <··········@usenet.ucs.indiana.edu> ········@silver.ucs.indiana.edu (lael schooler) writes:
I am doing some simulation work involving lots of floating point
operations. I am currently working in C, but I would vastly
prefer to work with LISP.
I have heard that there exist implementations of LISP
which are as fast as C. Is this true?
Also, can anybody point me to a source that gives examples of LISP
code that is optimized for speed? Do I have a chance to make a LISP
program run half as fast as the comparable C code?
See fastlisp.ps.Z and lisp-speed.txt in pub/lisp/common/docs
on laplace.stat.ucla.edu. This summarizes work by Richard Fateman
and others.
--- Jan
--
Jan de Leeuw; Dept Math UCLA; phone (310)-825-9550; fax (310)-206-6673
mail: 405 Hilgard Ave, Los Angeles, CA 90024-1555
INTERNET: ·······@laplace.stat.ucla.edu
In article <··········@usenet.ucs.indiana.edu> ········@silver.ucs.indiana.edu (lael schooler) writes:
Newsgroups: comp.lang.lisp
Path: news.bbn.com!noc.near.net!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!vixen.cso.uiuc.edu!usenet.ucs.indiana.edu!silver.ucs.indiana.edu!schooler
From: ········@silver.ucs.indiana.edu (lael schooler)
Sender: ····@usenet.ucs.indiana.edu (USENET News System)
Nntp-Posting-Host: silver.ucs.indiana.edu
Organization: Indiana University, Bloomington IN
Date: Fri, 4 Mar 1994 17:35:31 GMT
Lines: 15
I am doing some simulation work involving lots of floating point
operations. I am currently working in C, but I would vastly
prefer to work with LISP.
I have heard that there exist implementations of LISP
which are as fast as C. Is this true?
Yes, even faster.
Also, can anybody point me to a source that gives examples of LISP
code that is optimized for speed? Do I have a chance to make a LISP
program run half as fast as the comparable C code?
1. A good example of how to write fast math in Lisp, is Scott Fahlman's
Cascade Correlation Here are some ftp sources:
Lisp code: pt.cs.cmu.edu /afs/cs/project/connect/code cascor1.lisp
C code: pt.cs.cmu.edu /afs/cs/project/connect/code cascor-v1.0.3.shar
Postscript documents describing cascade correlation.
archive.cis.ohio-state pub/neuroprose fahlman.cascor-tr.ps.Z
archive.cis.ohio-state.edu /pub/neuroprose fahlman.cascor-tr.ps.Z
archive.cis.ohio-state.edu /pub/neuroprose klagges.rndwired-cascor.ps.Z
archive.cis.ohio-state.edu /pub/neuroprose yang.cascor.ps.Z
I did a fairly careful study of the lisp and C versions of this algorithm.
With several minor improvements, the Lisp is fast as C. The main
difference is that gcc C compiler can produce a 6 instruction dot product
loop where the Lisp's i've tried require 10 or 14 instructions. Thus the
difference at this point is the quality of the compiler, not any difference
in the language.
2. There is also a paper by Fateman and others: peoplesparc.berkeley.edu
~ftp/pub/papers fastlisp.ps that considers the issues and shows that Lisp
code can be about as fast as FORTRAN.
3. Check the FAQ for CMU Common Lisp. It's compiler provides very useful
optimization hints and the info mode documation provided for gnu emacs is
worth reading.
4. Contact me if you need help with specific issues.
--
Ken Anderson
Internet: ·········@bbn.com
BBN STC Work Phone: 617-873-3160
10 Moulton St. Home Phone: 617-643-0157
Mail Stop 6/4c FAX: 617-873-3776
Cambridge MA 02138
USA