

Re: SUN vs Lisp machine hardware differences?

    Date: Tue, 11 Aug 87 07:25 EDT
    From: Chris Lindblad <CJL@REAGAN.AI.MIT.EDU>

    I might like to add that there are architectural features of the Lisp Machine
    (all descendants of the MIT machine) that tend to make them slower than they
    need to be to run pure common lisp. The extensive use of forwarding pointers
    and cdr-coding, (which aren't at all needed for common lisp, but make the
    system a lot nicer to use) substantially increases the amount of memory
    references needed to execute programs. 

The way I see it, forwarding pointers mainly reduce the number of memory
references.  In a conventional implementation, you need an extra memory
reference for any adjustable array, whereas on a Lisp machine you only
need the extra memory reference if there has actually been forwarding.
To avoid the reference in the standard implementation, the programmer
has to go through the extra hassle of keeping track of which arrays are
adjustable and which are not.  This is a good example of a general
principle:  the tradeoffs between a Lisp machine and a conventional
machine often involve not just speed, not just convenience, but often a
tradeoff between these two and other factors.  And the quantity of
benefit and cost can depend a lot on your application and what sort of
thing you're doing.

Forwarding pointers do slow down certain operations that could not have
been done in the same way on a conventional machine.  But if you just
don't use them that way, then nothing else is slowed down.  The check
for forwarding pointers in done by the 36xx in parallel with all those
other checks it does on every memory reference.  So if you don't use
forwardings pointers, they don't slow you down.

					   The tradeoff here is that the
    advantages of having cdr-coding and forwarding pointers makes it possible to
    do things that you can't do in common lisp and speed up some parts of common

It's true that cdr-coding makes cdr take more memory references in some
cases.  But the intention of cdr-coding is to make lists take less
memory, which means fewer page faults, which means things are faster on
the whole.  As usual, it depends on your application and configuration
in ways that are hard to measure accurately: if you have plenty of extra
main memory, then the cdr-coding doesn't help and does slow things down

	  but other things (like eq) get slowed down. 

Actually, the EQ operation isn't slowed down at all in the Symbolics
architecture.  EQ is implemented as a simple equality comparison, in all
cases, and never references memory.  A lot of the hair in the garbage
collector and in the use of invisible pointers is devoted to keeping EQ
simple, so that it will be fast.

						      Forwarding pointers and
    locatives aren't in common lisp primarily because it's hard to do on stock

    In general if one limits one's discussion to common lisp, one will never find
    any feature that can't be done on one machine but can on another, because
    common lisp was designed so that there will be nothing that can't be done on
    common kinds of computers.