Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news4.ner.bbnplanet.net!news.ner.bbnplanet.net!news.mathworks.com!newsfeed.internetmci.com!in2.uu.net!news.biu.ac.il!discus.technion.ac.il!news!qobi
From: qobi@ee.technion.ac.il (Jeffrey Mark Siskind)
Subject: Re: efficiency of Lisp compared to other progr. lang.?
Reply-To: Qobi@EE.Technion.AC.IL
Organization: Technion, Israel Institute of Technology
Date: Sun, 25 Feb 1996 12:28:37 GMT
Message-ID: <QOBI.96Feb25142837@ee.technion.ac.il>
In-Reply-To: ap14@doc.ic.ac.uk's message of 23 Feb 1996 21:46:58 GMT
X-Nntp-Posting-Host: ee.technion.ac.il
References: <4glcki$l6g@frigate.doc.ic.ac.uk>
Sender: news@discus.technion.ac.il (News system)
Lines: 25

   I was told that compiled Prolog code is on the average about twice
   as slow as comparable code written in C, Pascal.
   How is the performance of Lisp compared to other programming languages?

That depends on lots of factors:

1. Whether or not the C and Lisp versions use the same algorithm.
2. The programming style used in C and Lisp.
3. The type of problem being solved (numeric vs. symbolic vs. ...)
4. The compiler(s) being used.
5. The optimization level settings on the compilers being used.
6. Whether appropriate declarations are given in the Lisp code (if
   declarations are allowed)

I have seen Lisp code that runs 35 times slower than C code and I have seen
Lisp code that runs 6 times *faster* than C code. So there is no easy answer
to your question. But I suggest that you take a look a Stalin, a highly
optimizing Scheme compiler available free from my home page. For certain
programs, particularly numeric ones, it generates code that is as good or
better than C, without any declarations.

    Jeff (home page http://www.cs.toronto.edu/~qobi)
--

    Jeff (home page http://www.cs.toronto.edu/~qobi)
