Compare the performance of Smalltalk GNU programs against some other language implementation, or check the Smalltalk Time and Memory measurements.

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

Compare to:

 The Smalltalk GNU programs compared [smaller is better]


Smalltalk GNU / Perl [smaller is better]
Program & Logs Time Memory Use Source Size Reduced N
chameneos-reduxNo program
regex-dnaFailed
recursive1/441 7
nsieve1/31/31
binary-trees1/251 14
fasta1/221
spectral-norm1/231
fannkuch1/232
n-body121
nsieve-bits223
partial-sums221
mandelbrot222
pidigits5612
sum-file622
k-nucleotide2113
reverse-complement3513

 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