Compare the performance of Smalltalk GNU programs against some other language implementation.

For more information about the Smalltalk implementation we measured see ↓ about Smalltalk GNU.

Compare to:

 Smalltalk GNU comparison summary


1/2 1/3 1/4 … Smalltalk GNU is better
Programs Time Memory Use Source Size Reduced N
chameneos-reduxNo program
binary-treesFailed
recursive1/57± 7
nsieve1/21/3±
fasta1/22±
fannkuch1/222 10
spectral-norm1/22±
n-body±4±
mandelbrot±22
nsieve-bits±33
partial-sums±2±
regex-dna48±
k-nucleotide10±3
pidigits201512
sum-file29±2
reverse-complement34±3

± look at the measurements

 Smalltalk GNU comparison measurements

Program & Logs CPU secs Memory KB Size B Elapsed secs ~ CPU Load
 recursive N = 7 reduced workload 
Smalltalk GNU6.7416,052510  
Perl #231.602,144380  
 nsieve 
Smalltalk GNU25.7376,568370  
Perl #260.70242,316290  
 fasta 
Smalltalk GNU #2435.456,7841298  
Perl #4850.673,156934  
 fannkuch N = 10 reduced workload 
Smalltalk GNU33.647,616777  
Perl58.983,144348  
 spectral-norm 
Smalltalk GNU2,547.8928,392476  
Perl #23,943.6318,536334  
 n-body 
Smalltalk GNU1,551.586,9121657  
Perl1,567.731,9041140  
 mandelbrot 
Smalltalk GNU #2415.846,188473  
Perl #2382.653,388311  
 nsieve-bits 
Smalltalk GNU120.6111,108754  
Perl93.554,024253  
 partial-sums 
Smalltalk GNU19.016,452558  
Perl #314.233,156389  
 regex-dna 
Smalltalk GNU61.26201,988502  
Perl #213.6625,048449  
 k-nucleotide 
Smalltalk GNU272.9152,904959  
Perl #227.5442,836359  
 pidigits 
Smalltalk GNU125.15475,396905  
Perl #26.213,144385  
 sum-file 
Smalltalk GNU #2444.2218,212186  
Perl15.5514,91684  
 reverse-complement 
Smalltalk GNU67.6448,904750  
Perl #21.9938,356298  

 about Smalltalk GNU

"Design Principles Behind Smalltalk" by Daniel Ingalls

GNU Smalltalk version 2.3.6

Home Page: GNU Smalltalk : The Smalltalk for those who can type

Download: Downloading GNU Smalltalk


--enable-jit was not available for this build


We've made the Smalltalk code a little more generic by abstracting out these implementation specific details, these are read from the command line before each script:

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

!Tests class methodsFor: 'platform'!
arg
   ^Smalltalk arguments first asInteger! !

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

!Tests class methodsFor: 'platform'!
stdinSpecial
   ^self stdin bufferSize: 4096! ! 

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

!Tests class methodsFor: 'platform'!
stdoutSpecial
   ^self stdout bufferSize: 4096! !

!Stream methodsFor: 'platform'!
print: number digits: decimalPlaces
   | n s |
   n := 0.5d0 * (10 raisedToInteger: decimalPlaces negated).
   s := ((number sign < 0) ifTrue: [number - n] ifFalse: [number + n]) printString.
   self nextPutAll: (s copyFrom: 1 to: (s indexOf: $.) + decimalPlaces)! !

!Stream methodsFor: 'platform'!
print: number paddedTo: width
   | s |
   s := number printString.
   self nextPutAll: (String new: (width - s size) withAll: $ ), s! !

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

Revised BSD license