[comp.lang.scheme] Scheme performance

swk@mlb.semi.harris.COM ("Song W. Koh") (10/13/90)

I am working on a neural network application and the following is an
informal comparison of performance :

Lucid Lisp: 0.28 seconds   
MIT Scheme: 2.5  seconds   
PC-Scheme:  7.4 seconds

The application is "quickprop" Written by Scott Fahlman in Common
Lisp. I made a literal translation from Common Lisp to Scheme. The
program uses global vectors to store information, which are
manipulated in nested "do" loops.  All times are for compiled files.

Can anyone explain the 10X difference between Lucid and MIT Scheme? 

Song Koh
Harris Semiconductor

Phone:		(407)-724-7085
Internet:	swk@mlb.semi.harris.com

swk@mlb.semi.harris.COM ("Song W. Koh") (10/14/90)

Thanks for the many replies.

The replies requested the following information.

Scheme Microcode Version 10.86
MIT Scheme, unix [bsd] version
Scheme saved on Monday June 25, 1990 at 8:17:14 AM
  Release 7.0.0 (beta)
  Microcode 10.86
  Runtime 14.46
  SF 4.8


Running on Sun4, SunOS Release 4.0.3

The Lucid code was comiled and has many declarations. 
The Scheme code was compiled using (sf "quickprop.scm").

Song Koh
Harris Semiconductor

Phone:		(407)-724-7085
Internet:	swk@mlb.semi.harris.com

jinx@zurich.ai.mit.edu (Guillermo J. Rozas) (10/14/90)

In article <9010140147.AA29045@seymour.mlb.semi.harris.com> swk@mlb.semi.harris.COM ("Song W. Koh") writes:

   Path: ai-lab!snorkelwacker!bloom-beacon!mlb.semi.harris.COM!swk
   From: swk@mlb.semi.harris.COM ("Song W. Koh")
   Newsgroups: comp.lang.scheme
   Date: 14 Oct 90 01:47:26 GMT
   Sender: root@athena.mit.edu (Wizard A. Root)
   Organization: The Internet
   Lines: 24


   Thanks for the many replies.

   The replies requested the following information.

   Scheme Microcode Version 10.86
   MIT Scheme, unix [bsd] version
   Scheme saved on Monday June 25, 1990 at 8:17:14 AM
     Release 7.0.0 (beta)
     Microcode 10.86
     Runtime 14.46
     SF 4.8


   Running on Sun4, SunOS Release 4.0.3

   The Lucid code was comiled and has many declarations. 
   The Scheme code was compiled using (sf "quickprop.scm").

   Song Koh
   Harris Semiconductor

   Phone:		(407)-724-7085
   Internet:	swk@mlb.semi.harris.com

Two comments:

- sf is NOT a native code compiler.  It is an SCode level optimizer.
SCode is the internal language that the interpreter understands.
The difference in time that you are observing is probably mostly 
the difference between interpretation and native code compilation.

Note that the native code compiler is called cf and calls sf as one of
its passes.  Unfortunately, there is no back end for Sun4s.

- sf will have almost no effect, and cf will not do very well if you
do not precede your code with

(declare (usual-integrations))

This declares to sf (and therefore cf) that often-used Lisp variables
(+, cons, car, etc.) will have their usual values at run time, and
thus they can be early bound and inline coded.

If this is not done, each call to these common variables will result
in an out-of-line call in the resulting code, rather than the few
instructions that could be generated for them.