From: Pete
Subject: Re: efficiency of Lisp compared to other progr. lang.?
Date: 
Message-ID: <4goegv$hds@news1.usa.pipeline.com>
On Feb 23, 1996 21:46:58 in article <efficiency of Lisp compared to other
progr. lang.?>, ·····@doc.ic.ac.uk (Alex Pfister)' wrote: 
 
 
> 
>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? 
> 
First, assuming skilled and experienced programmers, on a typical 
system using a reasonable mix of io and computation, Lisp is quite 
competitive to other OO systems.  It's true that it can't quite match 
C++ and other strongly and statically typed languages, in terms of 
raw speed, but it's not that far off. 
 
What I think has given Lisp a bad reputation for being slow is 
the amount of really beginner-like coding produced.  I have seen 
many OR and IS types get a two-week crash course on Lisp and 
then sit down and start writing a system.  These are typically 
very intelligent people and they get up to speed quite fast, but 
they're not programmers.  They often produce good algorithms 
for solving AI problems, but the details leave much to be desired. 
 
I have "correctected" many thousands of lines of code like this: 
  (cond ((equalp "A" (subseq data 0 1)) ...) 
          ((equalp "D" (subseq data 0 1)) ... 
 
Just this last week I dug up an old simulation model where 
the programmer had defined: 
 
(defmethod (get-slot-value myflavor) (slot) 
 (symbol-value-in-instance slot)) 
 
and then used (get-slot-value object 'foo) everywhere instead 
of calling the accessor functions directly. 
 
-- those who know Symbolics flavors of late 80's may recognize 
the syntax, and may also be aware that symbol-value-in-instance 
is about 50 times as slow as a direct function call.  I could 
understand this if the slot names were not known at compile 
time, but that wasn't the case.  Comments in the code indicated 
that the programmer thought he was very clever for having 
come up with that scheme. 
 
Anyway, the bottom line is that a properly written Lisp system 
can be very fast in operation, and can be developed in less 
than half the time required by "ordinary" languages such 
as C++. 
 
-- 
Pete Grant 
Kalevi, Inc. 
Software Engineering & development

From: Erik Naggum
Subject: Re: efficiency of Lisp compared to other progr. lang.?
Date: 
Message-ID: <19960225T100833Z@arcana.naggum.no>
[······@usa.pipeline.com(Pete)]

|   First, assuming skilled and experienced programmers, on a typical
|   system using a reasonable mix of io and computation, Lisp is quite
|   competitive to other OO systems.  It's true that it can't quite match
|   C++ and other strongly and statically typed languages, in terms of raw
|   speed, but it's not that far off.

is this true?  with CMU CL 17f and PCL, I get faster execution, less code,
and faster compilation than I do with C++ and templates using GCC 2.7.2.
if "raw speed" includes programmer time to achieve a working system, Lisp
_cannot_ lose.

#<Erik 3034231713743323>
-- 
the Internet made me do it
From: Anthony Berglas
Subject: Re: efficiency of Lisp compared to other progr. lang.?
Date: 
Message-ID: <4gr2ca$cqp@miso.cs.uq.edu.au>
In <··········@news1.usa.pipeline.com> ······@usa.pipeline.com(Pete) writes:

>On Feb 23, 1996 21:46:58 in article <efficiency of Lisp compared to other
>progr. lang.?>, ·····@doc.ic.ac.uk (Alex Pfister)' wrote: 
> 
> 
>> 
>>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? 

I did some crude bench marks of Lisp vs C for a simple prime number
generator and a neural net benchmarkk.  CMU Lisp actually beat sun and
gnu C for the prime number, probably because it combined a div and mod
operation, and was faster than Sun C and slightly slower than Gnu C
for the nural net.

I think the real speed issue is coding style and the types of programs
you write.

Anthony

--
Anthony Berglas
Rm 312a, Computer Science, Uni of Qld, 4072, Australia.
Uni Ph +61 7 3365 4184,  Home 3391 7727,  Fax 3365 1999
CSM Lair 3365 1181