Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsstand.cit.cornell.edu!portc01.blue.aol.com!newsxfer2.itd.umich.edu!howland.erols.net!cs.utexas.edu!swrinde!sdd.hp.com!hp-pcd!hp-cv!reuter.cse.ogi.edu!qiclab.scn.rain.com!gemstone.com!servio!servio!aland
From: aland@servio.slc.com (Alan Darlington)
Subject: Re: Is Smalltalk inherently slow?
Message-ID: <1996Aug7.192821.21041@gemstone.com>
Sender: news@gemstone.com (USENET News)
Nntp-Posting-Host: servio
Organization: GemStone Systems, Inc., Beaverton OR, USA
References: <3200CB93.31FF@eurocontrol.fr>
Date: Wed, 7 Aug 1996 19:28:21 GMT
Lines: 54

Richard Irvine <Richard.Irvine@eurocontrol.fr> writes:
> On the ISE web pages one can find a comparison of OO languages, see
> http://www.eiffel.com/doc/manuals/technology/oo_comparison/index.html
> 
> One of the comments in this comparison is:
> 
>   'Choose the right tool for the job. Smalltalk is
>    useful for prototypes, which ultimately have to
>    be thrown away because of serious
>    performance problems. But it is ridiculous to
>    waste precious engineering time and cost on
>    throw-aways.'
> 
> The perception that Smalltalk programs necessarily suffer
> from performance problems is fairly widespread.
> Probably this is because Smalltalk is usually interpreted.
> As a humble seeker after truth I would like to know
> whether there is anything about the language which means 
> that it cannot be compiled directly to object code?
> If it is possible to compile it to object code,
> why should it be any slower than any other language? 
> Why also is it usually interpreted rather than compiled?
> 
> Can anyone throw some light on this without 
> entering into a religious language war?

Most modern Smalltalk interpreters compile byte-codes on the
fly and cache the resulting native code.  At best (tight
loops, heavily re-used code), the Smalltalk version of an
algorithm will run as fast as C or C++ code.  At worst, it
usually takes no more than twice as long.

However, in real applications, all bets are off.  I have
seen a report about a Smalltalk application that ran 20-30%
faster than the same application in C.  Nobody would claim
that Smalltalk is inherently faster, but I believe that
Smalltalk coders finish their initial implementation much
faster (fewer lines of code to write, after all :-), giving
them more time to optimize critical code or to rewrite it
using better algorithms.

Since all projects have finite budgets and deadlines, I
think that this factor will become more of a critical point
when choosing an implementation language, as applications
are becoming more complex and companies must have software
completed sooner to remain competitive.

This is just an opinion, but I have worked on 3 commercial
applications written in Smalltalk (plus other stuff in
assembler, COBOL, and languages like C - things have
changed in the last 30 years :-).

  Cheers,
  Alan
