÷

 Step 1 : Are the Smalltalk VisualWorks programs faster? At a glance.

This chart shows 3 comparisons - Time-used, Memory-used and Code-used.

Each chart bar shows, for one unidentified benchmark, how much the fastest Smalltalk VisualWorks program used compared to the fastest Java 6 -server program.


 Step 2 : Are the Smalltalk VisualWorks programs faster? Approximately.

This table shows 3 comparisons - Time-used, Memory-used and Code-used.

Each table row shows, for one named benchmark, how much the fastest Smalltalk VisualWorks program used compared to the fastest Java 6 -server program.

 Smalltalk VisualWorks used what fraction? used how many times more? 
Benchmark Time Memory Code Reduced N
 partial-sums±±±
 binary-trees±±±
 nsieve±
 k-nucleotide1/2±
 nsieve-bits±±
 reverse-complement±±
 pidigits±
 fasta±±
 fannkuch±±
 regex-dna1/21/2
 chameneos-redux10×±
 sum-file12×±±
 spectral-norm14×±±
 recursive24×±
 n-body33×±±
 mandelbrot49×±±

± read the measurements and then read the program source code.

 Step 3 : Are the Smalltalk VisualWorks programs faster? Measurements.

This table shows 5 measurements - CPU Time, Elapsed Time, Memory, Code and ~ CPU Load.

For each named benchmark, measurements of the fastest Smalltalk VisualWorks program are shown for comparison against measurements of the fastest Java 6 -server program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ~ CPU Load
 partial-sums 
Smalltalk VisualWorks10.7212,676552  
Java 6 -server9.158,488474  
 binary-trees 
Smalltalk VisualWorks8.1126,852722  
Java 6 -server6.8926,808603  
 nsieve 
Smalltalk VisualWorks3.5232,556378  
Java 6 -server2.2520,592296  
 k-nucleotide 
Smalltalk VisualWorks57.1434,8681467  
Java 6 -server15.8970,9641052  
 nsieve-bits 
Smalltalk VisualWorks18.4517,060727  
Java 6 -server5.0413,364523  
 reverse-complement 
Smalltalk VisualWorks6.0951,036754  
Java 6 -server1.3058,932592  
 pidigits 
Smalltalk VisualWorks9.5720,872899  
Java 6 -server1.928,992938  
 fasta 
Smalltalk VisualWorks115.9412,6801329  
Java 6 -server21.469,1841240  
 fannkuch 
Smalltalk VisualWorks84.3812,652772  
Java 6 -server11.058,884555  
 regex-dna 
Smalltalk VisualWorks66.7444,092584  
Java 6 -server7.8175,892921  
 chameneos-redux 
Smalltalk VisualWorks170.6912,6722702  
Java 6 -server17.5112,0921429  
 sum-file 
Smalltalk VisualWorks50.7412,656185  
Java 6 -server4.109,972226  
 spectral-norm 
Smalltalk VisualWorks340.5314,464438  
Java 6 -server24.0110,008514  
 recursive 
Smalltalk VisualWorks161.8332,764509  
Java 6 -server6.7612,044427  
 n-body 
Smalltalk VisualWorks481.4412,7201652  
Java 6 -server14.7511,5241424  
 mandelbrot 
Smalltalk VisualWorks159.1812,656467  
Java 6 -server3.2411,092623  

 Measurements for all the accepted programs

 Smalltalk VisualWorks : uniform reflective environment - real live objects 

Code size measurements are misleading for Smalltalk because source files are usually only used to archive or transfer code. Smalltalk code is created, stored and run in a Smalltalk image. We show Smalltalk source code in a verbose chunk file format used to archive or transfer source code between Smalltalk images.

"Design Principles Behind Smalltalk" by Daniel Ingalls

VisualWorks(R) 7.6 Feb 14 2008

Home Page: Cincom Smalltalk™ VisualWorksl® Environment Data Sheet

Download: VisualWorksl® Non-Commercial


We've made the Smalltalk code a little more generic by abstracting out these implementation specific details:

Object subclass: #Tests
   instanceVariableNames: ''
   classVariableNames: ''
   poolDictionaries: ''
   category: 'Shootout'!


!Tests class methodsFor: 'platform'!
arg
   ^CEnvironment commandLine last asNumber! !

!Tests class methodsFor: 'platform'!
stdin
   ^Stdin! !


!Tests class methodsFor: 'platform'!
stdinSpecial
   ^ExternalReadStream on:
      (ExternalConnection ioAccessor: (UnixDiskFileAccessor new handle: 0))! !


!Tests class methodsFor: 'platform'!
stdout
   ^Stdout! !


!Tests class methodsFor: 'platform'!
stdoutSpecial
   ^ExternalWriteStream on:
      (ExternalConnection ioAccessor: (UnixDiskFileAccessor new handle: 1))! !


!Stream methodsFor: 'platform'!
nl
   self nextPut: Character lf! !


!Stream methodsFor: 'platform'!
print: number digits: decimalPlaces
   self nextPutAll:
      ((number asFixedPoint: decimalPlaces) printString copyWithout: $s)! !


!Stream methodsFor: 'platform'!
print: number paddedTo: width
   number printOn: self paddedWith: $  to: width base: 10! !


!Integer methodsFor: 'platform'!
asFloatD
   ^self asDouble! !

Revised BSD license