Re: Why are intepreters so slow today

Graham Matthews (graham@pact.srf.ac.uk)
Tue, 19 Apr 1994 09:54:56 GMT

Steven D. Majewski (sdm7g@elvis.med.Virginia.EDU) wrote:
> [on why interpreters are slow]
> They make the points:
> Compilers can agressively inline code to avoid procedure calls.
> Object oriented languages ( and, I would assert, interpreted
> languages in general ) use function/method calls for low-level
> operations.
> High call frequencies interfere with good performance.

Inlining can be done and is done in OO languages and interpreted languages.
(don't confuse the semantics of OO languages and abstraction with the
implementations of such languages). Your conclusion does not therefore
follow.

Steven D. Majewski (sdm7g@elvis.med.Virginia.EDU) wrote:
> So, I think that it may be valid to say that compilers have
> gotten much better, while interpreters, on average, have not.

I disagree. Interpreters have improved out of sight, by doing all the
things that compilers do, to the point of actually compiling some
or all of the source code. Indeed they have got so good, that it is
no longer clear where the demarcation between compiler and interpreter
is.

Steven D. Majewski (sdm7g@elvis.med.Virginia.EDU) wrote:
> Still, those Self papers seem to indicate that 10x penalty ought
> to be the "typical" penalty, and that, with some heroic tricks
> one ought to be able to do much better. [ Maybe I'm misreading
> this, but 10x is what they report for Smalltalk and an earlier
> version of Self. ]

Self has improved a lot since the early papers. The latest benchmarks
give something like 40% of the speed of C code.

Steven D. Majewski (sdm7g@elvis.med.Virginia.EDU) wrote:
> We have seen numbers all over the place for this example.
> Arithmetic *IS* a pathological case for some of these interpreted
> languages

As far as I can see its only a pathological example for an interpreter
that doesn't have a sophisticated implementation (for example does not
support floats very well, does no optimisation phases, does not compile
to at least byte code, etc).

Steven D. Majewski (sdm7g@elvis.med.Virginia.EDU) wrote:
> [on needing better benchmarks and the SELF group]
> They mention the "Richards" benchmark, but the reference in
> the back says "private communication".

ftp to self.stanford.edu and you can pick the richards benchmark up
written in C++, Self, and I think Smalltalk. You can also pick up papers
giving latest performance etc.

graham

--
        ------------------------------------------------------
         I would gladly die for a man who was looking for the 
        truth, but would just as gladly kill a man who thought 
                he had actually found it -- Voltaire
        -----------------------------------------------------