÷

 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
 fasta±±
 binary-trees1/2±
 chameneos-redux±
 reverse-complement1/2±
 pidigits11×±1/2
 n-body13×±±
 k-nucleotide15×±± 2,500,000
 regex-dna26×1/21/2
 spectral-norm27×±1/2
 fannkuch34×±±
 mandelbrot99×1/41/2

± 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
 fasta 
Smalltalk VisualWorks47.1047.0912,7521171  0% 0% 0% 100%
Java 6 -server7.507.4912,6481240  0% 1% 99% 0%
 binary-trees 
Smalltalk VisualWorks138.23138.22121,988722  0% 1% 0% 100%
Java 6 -server29.6319.18289,920603  24% 75% 27% 28%
 chameneos-redux 
Smalltalk VisualWorks60.8660.8512,7722515  0% 100% 0% 0%
Java 6 -server22.808.2412,5921377  50% 54% 84% 73%
 reverse-complement 
Smalltalk VisualWorks26.6926.69289,904754  100% 0% 0% 0%
Java 6 -server2.982.94473,712592  1% 94% 4% 2%
 pidigits 
Smalltalk VisualWorks56.8856.8832,936899  0% 0% 0% 100%
Java 6 -server12.955.0028,6241816  61% 59% 57% 55%
 n-body 
Smalltalk VisualWorks325.56325.5412,7961652  0% 100% 0% 1%
Java 6 -server25.0325.0312,4081424  100% 0% 0% 0%
 k-nucleotide N = 2,500,000 reduced workload 
Smalltalk VisualWorks30.2130.21164,6961191  0% 0% 100% 0%
Java 6 -server6.172.07145,2961602  87% 67% 75% 69%
 regex-dna 
Smalltalk VisualWorks316.57316.58296,392584  100% 0% 1% 1%
Java 6 -server30.6412.27665,900929  51% 54% 71% 74%
 spectral-norm 
Smalltalk VisualWorks111.96111.9514,524438  0% 0% 0% 100%
Java 6 -server15.954.1112,552950  97% 97% 98% 97%
 fannkuch 
Smalltalk VisualWorks619.65619.6112,724772  0% 1% 0% 100%
Java 6 -server66.2618.4313,7761150  78% 77% 98% 99%
 mandelbrot 
Smalltalk VisualWorks1,085.491,085.4212,740467  0% 0% 0% 100%
Java 6 -server43.1210.9548,920903  98% 98% 99% 98%

 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