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
regex-dnaFailed
recursive1/44± 7
nsieve1/31/3±
binary-trees1/25± 14
fasta1/22±
spectral-norm1/23±
fannkuch1/232
n-body±2±
nsieve-bits223
partial-sums22±
mandelbrot222
pidigits5612
sum-file622
k-nucleotide21±3
reverse-complement35±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 GNU9.818,500510  
Perl #236.282,080380  
 nsieve 
Smalltalk GNU #27.7839,276384  
Perl #225.45121,904290  
 binary-trees N = 14 reduced workload 
Smalltalk GNU21.0165,364729  
Perl #241.7613,128541  
 fasta 
Smalltalk GNU #2486.083,8201311  
Perl #4950.041,872934  
 spectral-norm 
Smalltalk GNU2,193.846,192476  
Perl #24,089.082,468334  
 fannkuch 
Smalltalk GNU539.453,860777  
Perl855.721,492348  
 n-body 
Smalltalk GNU2,417.384,2881657  
Perl1,697.591,9361140  
 nsieve-bits 
Smalltalk GNU157.768,160733  
Perl100.184,004253  
 partial-sums 
Smalltalk GNU31.833,652558  
Perl #317.411,476389  
 mandelbrot 
Smalltalk GNU #2739.113,592473  
Perl #2403.201,724311  
 pidigits 
Smalltalk GNU19.27154,732905  
Perl #23.612,532385  
 sum-file 
Smalltalk GNU #3111.393,560178  
Perl18.171,46884  
 k-nucleotide 
Smalltalk GNU659.2647,956959  
Perl #232.0742,816359  
 reverse-complement 
Smalltalk GNU69.0449,124750  
Perl #21.9938,360298  

 about Smalltalk GNU

"Design Principles Behind Smalltalk" by Daniel Ingalls

GNU Smalltalk version 3.0.2

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