a tale of 4 cpus (was: CPU running smalltalk bytecode)

Greg & Cindy Gritton gritton.family at verizon.net
Thu Feb 14 09:10:28 UTC 2002


On Monday 11 February 2002 21:28, Jecel Assumpcao Jr wrote:
>
>Anyone interested in hardware implementation of OO languages should 
>read:
>
>  Do object-oriented languages need special hardware support?
>  by Urs Hölzle and David Ungar
>  http://www.cs.ucsb.edu/labs/oocsb/papers/oo-hardware.html
>
>Here they contradict most of the results that David Ungar had obtained 
>in SOAR (Smalltalk On A RISC). Note that I happen not to agree with 
>their conclusions, but it is a good paper even so.

The work done by David Ungar was fantastic.  The SOAR project he
worked on managed, at 2.5MHz, to have performance compariable to
the 14-16MHz Dorado.  Part of that was the fact that it was
a RISC processor, which made far better use of transistors than
most processors of the time, but a large part seemed to be his
approach.

He appeared to develop his version of Smalltalk by looking at 
what would be the fastest possible way of implementing a 
particular operation, such as integer addition or comparisons,
method calling, etc.  His team then implemented those in
a combination of software and hardware as appropriate.

Unfortunately, I havn't really seen anyone follow his approach
to a Smalltalk implementation after what he did.  I don't mean
custom hardware - a custom Smalltalk processor would be a difficult
sell - but on the software side.  People have seemed to be content
to take the base image and gradually speed things up, adding
compiling here, reorganizing object memory there, etc.
This is in stark contrast to the the bottom-up approach used
in SOAR.

>From what I have been able to pick up from papers, documentation,
etc. of various versions of Smalltalk, none seem to have as
effecient of isntruction sequences as SOAR had, even without 
the special hardware.  VisualWorks (particularly with the new
contexts) may be the only exception.

David Ungar wasn't content to stop at SOAR.  He went on to work
on the Self system, which did groundbreaking research into 
compiler optimization for Self and Smalltalk. 

However, that work was not without its problems.  As an example,  
Around 1990 I had used Smalltalk-V for Macintosh on a 16MHz (3MIPS)
5MB Mac-II and found its performance to be fine.  In benchmarks it 
ran at 1/10 the speed of optimized C, but the only thing that felt 
slow using it was tha menu items took about 1/2 second to come up 
instead of coming up instantly.  

A few years later I had the opportunity to try out the Self system.
This time I was running on a 70MHz, ~70MIPS, 64MB SparcStation.
Unfortunately, and despite benchmarks running at around 1/4 of
optimized C, the system crawled in actual use.  It wasn't quite
painful to use, but it was close.

It was from this background that the paper "Do object-oriented languages 
need special hardware support?" by Urs Hölzle and David Ungar comes.
Their primary claim was that because optimizing compilers for 
object-oriented languages such as Smalltalk produced code whose
instructions mix matched those of C programs, that hardware support
such as tag bits weren't helpful.  Yet, such optimizing compilers
are so complex, and Self's was so memory hungry and slow for
interactive use, that no highly optimizing compiler (like Self's)
has ever been released for a commercial Smalltalk system.

Of course, for most of us the hardware support issue it is a moot 
point.  It probably isn't practical to design a processor for 
Smalltalk, at least commercially.  But, we could work on 
implementing a high-performance VM for Smalltalk (Squeak in 
particular), with the approach of looking for the fastest 
instruction sequences that could accomplish common tasks.
Using what David Ungar found for SOAR would be an excellent
starting point.

Some references to SOAR include:
  Architecture of SOAR, Smalltalk on a RISC
     David Ungar, Ricki Blau, Peter Foley, A. Dain Samples, David A. Patterson
     Proc. 11th Annual Symposium on Computer Architecture, pages 188-197, June 1984
  SOAR: Smalltalk Without Bytecodes
     A. Dain Samples, David Ungar, Paul Hilfinger
     Conference on Object-Oriented Programming Systems, Languages, 
     and Applications (OOPSLA'86), Portland, Oregon, Proceedings. 
     SIGPLAN Notices 21(11), November 1986
  The Design and Evaluation of a High Performance Smalltalk System
     David M. Ungar (Thesis at Berkeley, California)
     The MIT Press, Cambridge, Massachusetts, London, England
  Smalltalk-80 to SOAR Code
     William R. Bush
     Computer Science Division
     Department of Electrical Engineering and Computer Science
     University of California Berkeley    (T7.49 B983 engi)

Sincerely,

Greg Gritton
 





More information about the Squeak-dev mailing list