Gentoo : Intel® Pentium® 4 |
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.
| Smalltalk GNU / Perl [smaller is better] | ||||
|---|---|---|---|---|
| Program & Logs | Time | Memory Use | Source Size | Reduced N |
| chameneos-redux | ||||
| regex-dna | ||||
| recursive | 1/4 | 4 | 1 | 7 |
| nsieve | 1/3 | 1/3 | 1 | |
| binary-trees | 1/2 | 5 | 1 | 14 |
| fasta | 1/2 | 2 | 1 | |
| spectral-norm | 1/2 | 3 | 1 | |
| fannkuch | 1/2 | 3 | 2 | |
| n-body | 1 | 2 | 1 | |
| nsieve-bits | 2 | 2 | 3 | |
| partial-sums | 2 | 2 | 1 | |
| mandelbrot | 2 | 2 | 2 | |
| pidigits | 5 | 61 | 2 | |
| sum-file | 6 | 2 | 2 | |
| k-nucleotide | 21 | 1 | 3 | |
| reverse-complement | 35 | 1 | 3 | |
"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! !